Sha256: f7d5e0086ca46825efe0bcdee7a1977ae57caa7d23c3ac56b85a17264ae85179

Contents?: true

Size: 1.15 KB

Versions: 1

Compression:

Stored size: 1.15 KB

Contents

require 'aruba-doubles'

World(ArubaDoubles)

Before do
  ArubaDoubles::Double.setup
end

After do
  ArubaDoubles::Double.teardown
  history.clear
end

Given /^I double `([^`]*)`$/ do |cmd|
  double_cmd(cmd)
end

Given /^I double `([^`]*)` with "([^"]*)"$/ do |cmd, stdout|
  double_cmd(cmd, :puts => stdout)
end

Given /^I double `([^`]*)` with stdout:$/ do |cmd, stdout|
  double_cmd(cmd, :puts => stdout)
end

Given /^I double `([^`]*)` with exit status (\d+) and stdout:$/ do |cmd, exit_status, stdout|
  double_cmd(cmd, :puts => stdout, :exit => exit_status.to_i)
end

Given /^I double `([^`]*)` with stderr:$/ do |cmd, stderr|
  double_cmd(cmd, :warn => stderr)
end

Given /^I double `([^`]*)` with exit status (\d+) and stderr:$/ do |cmd, exit_status, stderr|
  double_cmd(cmd, :warn => stderr, :exit => exit_status.to_i)
end

Given /^I double `([^`]*)` with exit status (\d+)$/ do |cmd, exit_status|
  double_cmd(cmd, :exit => exit_status.to_i)
end

Then /^the double `([^`]*)` should have been run$/ do |cmd|
  history.should include(cmd.shellsplit)
end

Then /^the double `([^`]*)` should not have been run$/ do |cmd|
  history.should_not include(cmd.shellsplit)
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
aruba-doubles-1.2.0 lib/aruba-doubles/cucumber.rb