WARNING: This repo will no longer be maintained by me, @facto. I have moved entirely away from espec in favor of exunit. If you are interested in maintaining this, let me know and I will transfer control to you.
Provides Test That JSON! assertions for use with ESpec.
-
be_json_equal -
have_json_keys -
have_only_json_keys -
have_json_values -
have_only_json_values -
have_json_properties -
have_only_json_properties -
have_json_path -
have_json_type -
have_json_size
See Test That JSON!'s configuration instructions.
defmodule MyProject.ExampleSpec
use ESpec
use TestThatJson.ESpec
describe "verifying JSON key presence" do
subject do: json
let :json do
load_json("spec/support/json/valid.json")
end
it do: has_json_keys(["hello", "world"])
end
endAdd test_that_json_espec as a test-only dependency in mix.exs:
def deps do
[
{:test_that_json_espec, "~> 0.7.0", only: :test},
]
end- Before opening a pull request, please open an issue first.
- Do the usual fork/add/fix/run tests dance, or whatever tickles your fancy. Tests are highly encouraged.
- Open a PR.
- Treat yourself. You deserve it.
See the LICENSE file for license rights and limitations (MIT).