Sha256: 70bee7d4155c2deab410b7da1cb0a94e8fca816e5ea6af2bb6c98c4890e3a5fb

Contents?: true

Size: 1.05 KB

Versions: 6

Compression:

Stored size: 1.05 KB

Contents

Given %r{^a file named "([^"]+)" with:$} do |file_name, code|
  create_file(file_name, code)
end


When %r{^I run "spec ([^"]+)"$} do |file_and_args|
  spec(file_and_args)
end

When %r{^I run "ruby ([^"]+)"$} do |file_and_args|
  ruby(file_and_args)
end

When %r{^I run "cmdline.rb ([^"]+)"$} do |file_and_args|
  cmdline(file_and_args)
end


Then /^the (.*) should match (.*)$/ do |stream, string_or_regex|
  written = case(stream)
    when 'stdout' then last_stdout
    when 'stderr' then last_stderr
    else raise "Unknown stream: #{stream}"
  end
  written.should smart_match(string_or_regex)
end

Then /^the (.*) should not match (.*)$/ do |stream, string_or_regex|
  written = case(stream)
    when 'stdout' then last_stdout
    when 'stderr' then last_stderr
    else raise "Unknown stream: #{stream}"
  end
  written.should_not smart_match(string_or_regex)
end

Then /^the exit code should be (\d+)$/ do |exit_code|
  if last_exit_code != exit_code.to_i
    raise "Did not exit with #{exit_code}, but with #{last_exit_code}. Standard error:\n#{last_stderr}"
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
rspec-1.2.7 features/step_definitions/running_rspec_steps.rb
rspec-1.2.8 features/step_definitions/running_rspec_steps.rb
rspec-1.2.3 features/step_definitions/running_rspec_steps.rb
rspec-1.2.4 features/step_definitions/running_rspec_steps.rb
rspec-1.2.5 features/step_definitions/running_rspec_steps.rb
rspec-1.2.6 features/step_definitions/running_rspec_steps.rb