Created
February 20, 2012 20:35
-
-
Save crimsonknave/1871244 to your computer and use it in GitHub Desktop.
Adding descriptions to json_spec matchers
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class JsonSpec::Matchers::BeJsonEql | |
def description | |
"be equal to #{@expected}#{" at path #{@path}" if @path}" | |
end | |
end | |
class JsonSpec::Matchers::HaveJsonPath | |
def description | |
"have json path #{@path}" | |
end | |
end | |
class JsonSpec::Matchers::HaveJsonType | |
def description | |
"be json type #{@klass}#{" at path #{@path}" if @path}" | |
end | |
end | |
class JsonSpec::Matchers::HaveJsonSize | |
def description | |
"be #{@expected} long#{" at path #{@path}" if @path}" | |
end | |
end | |
class JsonSpec::Matchers::IncludeJson | |
def description | |
"include #{@expected_json}#{" at path #{@path}" if @path}" | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment