File tree Expand file tree Collapse file tree
spec/octocatalog-diff/tests/api/v1 Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ # frozen_string_literal: true
2+
3+ require_relative '../../spec_helper'
4+
5+ require OctocatalogDiff ::Spec . require_path ( '/api/v1/fact_override' )
6+
7+ describe OctocatalogDiff ::API ::V1 ::FactOverride do
8+ describe '#new' do
9+ it 'should raise error if key is not supplied' do
10+ expect { described_class . new ( value : 'bar' ) } . to raise_error ( KeyError , /key/ )
11+ end
12+
13+ it 'should raise error if value is not supplied' do
14+ expect { described_class . new ( key : 'bar' ) } . to raise_error ( KeyError , /value/ )
15+ end
16+ end
17+
18+ describe '#key' do
19+ it 'should return key' do
20+ testobj = described_class . new ( key : 'foo' , value : 'bar' )
21+ expect ( testobj . key ) . to eq ( 'foo' )
22+ end
23+ end
24+
25+ describe '#value' do
26+ it 'should return value' do
27+ testobj = described_class . new ( key : 'foo' , value : 'bar' )
28+ expect ( testobj . value ) . to eq ( 'bar' )
29+ end
30+ end
31+ end
You can’t perform that action at this time.
0 commit comments