module RSpec::Hal::Matchers
Public Instance Methods
have_property(*args)
click to toggle source
Signature
expect(a_doc).to have_property "name" expect(a_doc).to have_property "name, matching(/alice/i) expect(a_doc).to have_property("name").matching(/alice/i) expect(a_doc).to have_property("hobbies").including(matching("golf")) expect(a_doc).to have_property("name").that_is("Bob") expect(a_doc).to have_property("age").that_is kind_of Numeric
# File lib/rspec/hal/matchers.rb, line 47 def have_property(*args) HavePropertyMatcher.new(*args) end
have_relation(*args)
click to toggle source
Signature
expect(doc).to have_relation(link_rel) expect(doc).to have_relation(link_rel, href_matcher) expect(doc).to have_relation(link_rel, template_variables) expect(doc).to have_relation(link_rel, template_variables, href_matcher)
Examples
expect(authors_doc).to have_relation("search", {q: "Alice"}, match(%r|users/42|))
# File lib/rspec/hal/matchers.rb, line 34 def have_relation(*args) RelationMatcher.new(*args) end
have_templated_relation(*args)
click to toggle source
Examples
expect(doc).to have_templated_relation("search") expect(doc).to have_templated_relation("search", matching("{?q}"))
# File lib/rspec/hal/matchers.rb, line 18 def have_templated_relation(*args) TemplatedRelationMatcher.new(*args) end
have_variables(*args)
click to toggle source
Signature
expect(a_uri_template_str).to have_variables "q", "limit" expect(a_uri_template_str).to has_variable "q"
# File lib/rspec/hal/matchers.rb, line 55 def have_variables(*args) UriTemplateHasVariablesMatcher.new(*args) end