class Object
Public Instance Methods
debug_lists(expected, obtained)
click to toggle source
# File lib/shared_examples.rb, line 51 def debug_lists(expected, obtained) return unless ENV['VERBOSE'] return if expected.sort == obtained.sort to_read = expected.count > obtained.count ? expected : obtained columnize = "\t\t\t\t | \t\t\t\t" puts " | Expected #{columnize} GOT" to_read.each_with_index do |_, index| ok = expected[index] == obtained[index] ? 'v' : 'x' puts "[#{ok}] | #{expected[index]} #{columnize} #{obtained[index]}" end end
message_type(message)
click to toggle source
# File lib/shared_examples.rb, line 47 def message_type(message) message.to_h.keys.first end
parse_ndjson(ndjson)
click to toggle source
# File lib/shared_examples.rb, line 43 def parse_ndjson(ndjson) Cucumber::Messages::NdjsonToMessageEnumerator.new(ndjson) end
parse_ndjson_file(path)
click to toggle source
# File lib/shared_examples.rb, line 39 def parse_ndjson_file(path) parse_ndjson(File.read(path)) end