spec/lib/mulder/instance_spec.rb in mulder-0.3.2 vs spec/lib/mulder/instance_spec.rb in mulder-0.4.0

- old
+ new

@@ -9,10 +9,25 @@ fog_compute_instance = mock described_class.new(fog_compute_instance).fog_compute_instance.should == fog_compute_instance end end + describe '#exists?' do + context 'when there is a compute instance' do + it 'returns true' do + fog_compute_instance = mock + described_class.new(fog_compute_instance).should exist + end + end + + context 'when there no compute instance' do + it 'returns false' do + described_class.new(nil).should_not exist + end + end + end + describe '#as_hash' do let(:instance) { mock(attributes) } it 'has the expected attributes' do described_class.new(instance).as_hash.should == attributes @@ -29,6 +44,6 @@ described_class.new(instance).as_hash.should == attributes.reject { |key, _| key == :id } end end -end \ No newline at end of file +end