Sha256: 9bcfc4a27f9d9b4d166b37f7e788057db800fa768cc7f8f392effa7e9e6c1ac7
Contents?: true
Size: 1.44 KB
Versions: 11
Compression:
Stored size: 1.44 KB
Contents
When /^I run "jsus (.*?)"$/ do |args| Dir.chdir DATA_DIR do `#{JSUS_CLI_PATH} #{args}` end end Then /^the following files should exist:$/ do |table| Dir.chdir DATA_DIR do table.raw.each do |item| filename = item[0] File.exists?(filename).should be_true end end end Then /^file "(.*?)" should contain$/ do |filename, content| Dir.chdir DATA_DIR do File.read(filename).should include(content) end end Then /^file "(.*?)" should not contain$/ do |filename, content| Dir.chdir DATA_DIR do File.read(filename).should_not include(content) end end Then /^file "(.*?)" should contain valid JSON$/i do |filename| Dir.chdir DATA_DIR do json = nil lambda { json = JSON.load(File.read(filename)) }.should_not raise_error json.should_not be_nil end end Then /^file "(.*?)" should contain JSON equivalent to$/i do |filename, expected_json| Dir.chdir DATA_DIR do json = JSON.load(File.read(filename)) expected = JSON.load(expected_json) json.should == expected end end Then /^file "(.*?)" should have "(.*?)" (before|after) "(.*?)"$/ do |filename, what, position, other| Dir.chdir DATA_DIR do position = [] contents = File.read(filename) position << contents.index(what) position << contents.index(other) case position when "before" position[0].should < position[1] when "after" position[1].should < position[0] end end end
Version data entries
11 entries across 11 versions & 1 rubygems