module AssertJson
nodoc
nodoc
Constants
- VERSION
Public Instance Methods
assert_json(json_string) { |json| ... }
click to toggle source
# File lib/assert_json/assert_json.rb, line 3 def assert_json(json_string) return unless block_given? @json = AssertJson::Json.new(json_string) # json.instance_exec(json, &block) yield @json @json.test_for_unexpected_keys('root') end
has(*args, &block)
click to toggle source
# File lib/assert_json/assert_json.rb, line 20 def has(*args, &block) @json.has(*args, &block) end
has_length_of(expected)
click to toggle source
# File lib/assert_json/assert_json.rb, line 12 def has_length_of(expected) @json.has_length_of(expected) end
item(index, &block)
click to toggle source
# File lib/assert_json/assert_json.rb, line 16 def item(index, &block) @json.item(index, &block) end
not?(*args, &block)
click to toggle source
# File lib/assert_json/assert_json.rb, line 24 def not?(*args, &block) @json.has_not(*args, &block) end
Also aliased as: has_not
only?()
click to toggle source
# File lib/assert_json/assert_json.rb, line 29 def only? @json.has_only end
Also aliased as: has_only