spec/lib/hybag/ingester_spec.rb in hybag-0.0.10 vs spec/lib/hybag/ingester_spec.rb in hybag-0.0.11
- old
+ new
@@ -77,11 +77,11 @@
context "when there is no discoverable model" do
before(:each) do
subject.stub(:model_name).and_return(nil)
end
it "should raise an error" do
- expect{subject.ingest}.to raise_error("Unable to determine model from bag")
+ expect{subject.ingest}.to raise_error(Hybag::UndiscoverableModelName)
end
end
context "when there is a model" do
it "should return an instance of that model" do
expect(subject.ingest).to be_kind_of(BaggableDummy)
@@ -92,10 +92,10 @@
context "and that model is not defined" do
before(:each) do
subject.stub(:model_name).and_return("Blabla")
end
it "should raise an error" do
- expect{subject.ingest}.to raise_error
+ expect{subject.ingest}.to raise_error(NameError)
end
end
end
describe "returned model" do
let(:built_model) {subject.ingest}