spec/psd_spec.rb in psd-0.4.2 vs spec/psd_spec.rb in psd-1.0.0

- old
+ new

@@ -3,24 +3,26 @@ describe 'PSD' do let(:filename) { 'spec/files/example.psd' } it 'should open a file without a block' do psd = PSD.open(filename) - psd.parsed?.should == true - psd.should be_instance_of PSD + expect(psd).to be_parsed + expect(psd).to be_an_instance_of(PSD) end it 'should refuse to open a bad filename' do expect { PSD.open('') }.to raise_error end it 'should open a file and feed it to a block' do PSD.open(filename) do |psd| - psd.parsed?.should == true - psd.should be_instance_of PSD + expect(psd).to be_parsed + expect(psd).to be_an_instance_of(PSD) end end + # We have to use #should syntax here because the DSL binds + # the block to the PSD instance. it 'should open a file and feed it to a block DSL style' do PSD.open(filename) do parsed?.should == true is_a?(PSD).should == true end \ No newline at end of file