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.

message_steps.rb 725 B

2 years ago
1234567891011121314151617181920
  1. Then('messages types should be:') do |expected_types|
  2. parsed_json = command_line.stdout.split("\n").map { |line| JSON.parse(line) }
  3. message_types = parsed_json.map(&:keys).flatten.compact
  4. expect(expected_types.split("\n").map(&:strip)).to contain_exactly(*message_types)
  5. end
  6. Then('output should be valid NDJSON') do
  7. command_line.stdout.split("\n").map do |line|
  8. expect { JSON.parse(line) }.not_to raise_exception
  9. end
  10. end
  11. Then('the output should contain NDJSON with key {string}') do |key|
  12. expect(command_line.stdout).to match(/"#{key}":/)
  13. end
  14. Then('the output should contain NDJSON with key {string} and value {string}') do |key, value|
  15. expect(command_line.stdout).to match(/"#{key}": ?"#{value}"/)
  16. end

No Description

Contributors (1)