Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Add tests for the JSON type matcher convenience types

  • Loading branch information...
commit ec0b929a0501590b5135317af1222a440ea55280 1 parent a1dc71a
@laserlemon laserlemon authored
Showing with 12 additions and 2 deletions.
  1. +12 −2 spec/json_spec/matchers/have_json_type_spec.rb
View
14 spec/json_spec/matchers/have_json_type_spec.rb
@@ -2,7 +2,9 @@
describe JsonSpec::Matchers::HaveJsonType do
it "matches hashes" do
- %({}).should have_json_type(Hash)
+ hash = %({})
+ hash.should have_json_type(Hash)
+ hash.should have_json_type(:object)
end
it "matches arrays" do
@@ -34,6 +36,11 @@
%(1e+1).should have_json_type(Float)
end
+ it "matches booleans" do
+ %(true).should have_json_type(:boolean)
+ %(false).should have_json_type(:boolean)
+ end
+
it "matches ancestor classes" do
%(10).should have_json_type(Numeric)
%(10.0).should have_json_type(Numeric)
@@ -73,7 +80,10 @@
end
it "matches null" do
- %(null).should have_json_type(NilClass)
+ null = %(null)
+ null.should have_json_type(NilClass)
+ null.should have_json_type(:nil)
+ null.should have_json_type(:null)
end
end
end
Please sign in to comment.
Something went wrong with that request. Please try again.