spec/bogus/fakes/creates_fakes_spec.rb in bogus-0.1.4 vs spec/bogus/fakes/creates_fakes_spec.rb in bogus-0.1.5

- old
+ new

@@ -21,19 +21,19 @@ mock(converts_name_to_class).convert(:foo) { Foo } mock(copies_classes).copy(Foo) { fake_class } end it "creates a new instance of copied class by default" do - creates_fakes.create(:foo).should == fake_instance + expect(creates_fakes.create(:foo)).to eq fake_instance end it "creates a new instance of copied class if called with as: :instance" do - creates_fakes.create(:foo, as: :instance).should == fake_instance + expect(creates_fakes.create(:foo, as: :instance)).to eq fake_instance end it "copies class but does not create an instance if called with as: :class" do - creates_fakes.create(:foo, as: :class).should == fake_class + expect(creates_fakes.create(:foo, as: :class)).to eq fake_class end it "raises an error if the as mode is not known" do expect do creates_fakes.create(:foo, as: :something) @@ -46,17 +46,17 @@ stub(converts_name_to_class).convert mock(copies_classes).copy(Bar) { fake_class } end it "uses the class provided" do - creates_fakes.create(:foo){Bar}.should == fake_instance + expect(creates_fakes.create(:foo){Bar}).to eq fake_instance end it "does not convert the class name" do creates_fakes.create(:foo) { Bar} - copies_classes.should_not have_received.convert + expect(copies_classes).to_not have_received.convert end end module FooBarDuck end @@ -66,9 +66,9 @@ stub(makes_ducks).make(Foo, Bar) { FooBarDuck } stub(copies_classes).copy(FooBarDuck) { :the_fake } fake = creates_fakes.create(:role, as: :class) { [Foo, Bar] } - fake.should == :the_fake + expect(fake).to eq :the_fake end end end