You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

json_steps.rb 609 B

2 years ago
12345678910111213141516171819202122
  1. Then('it should fail with JSON:') do |json|
  2. expect(command_line).to have_failed
  3. actual = normalise_json(JSON.parse(command_line.stdout))
  4. expected = JSON.parse(json)
  5. expect(actual).to eq expected
  6. end
  7. Then('it should pass with JSON:') do |json|
  8. expect(command_line).to have_succeded
  9. actual = normalise_json(JSON.parse(command_line.stdout))
  10. expected = JSON.parse(json)
  11. expect(actual).to eq expected
  12. end
  13. Then('file {string} should contain JSON:') do |filename, json|
  14. actual = normalise_json(JSON.parse(File.read(filename)))
  15. expected = JSON.parse(json)
  16. expect(actual).to eq expected
  17. end

No Description

Contributors (1)