spec/optional_spec.rb in strong_json-0.9.0 vs spec/optional_spec.rb in strong_json-1.0.0
- old
+ new
@@ -11,9 +11,12 @@
it "accepts number" do
expect(type.coerce(3)).to eq(3)
end
it "rejects string" do
- expect { type.coerce("a") }.to raise_error(StrongJSON::Type::Error)
+ expect { type.coerce("a") }.to raise_error(StrongJSON::Type::TypeError) {|e|
+ expect(e.path.to_s).to eq("$")
+ expect(e.type).to be_a(StrongJSON::Type::Base)
+ }
end
end
end