Sha256: 3415f41afa9873c540f8d2882b5aa6463f7b86063a9816e1669c34e327ba3c99
Contents?: true
Size: 1.28 KB
Versions: 3
Compression:
Stored size: 1.28 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 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
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
jsus-0.2.3 | features/step_definitions/cli_steps.rb |
jsus-0.2.2 | features/step_definitions/cli_steps.rb |
jsus-0.2.1 | features/step_definitions/cli_steps.rb |