Sha256: 577048d5567f4f9fca6ec6fd3f156836cb0d4dd7cfd1ea63479dbc4721caf255

Contents?: true

Size: 963 Bytes

Versions: 2

Compression:

Stored size: 963 Bytes

Contents

Given /^I have (tried to |)run cucover (.*)$/ do |tried, args|
  When %{I run cucover #{args}}
  if tried.blank?
    assert(@status == 0, @out)
  end
end

Given /^I am using the (.*) example app$/ do |app_name|
  @example_app = app_name
  clear_cache!
end

When /^I run cucover (.*)$/ do |args|
  cucover_binary = File.expand_path(File.dirname(__FILE__) + '../../../bin/cucover')
  within_examples_dir do
    full_cmd = "#{Cucumber::RUBY_BINARY} #{cucover_binary} #{args}"
    @out = `#{full_cmd}`
    @status = $?.exitstatus
  end
end

When /^I edit the source file (.*)$/ do |source_file|
  within_examples_dir do
    edit source_file
  end
end

Then /^it should (pass|fail) with:$/ do |expected_status, expected_text|
  expected_status_code = expected_status == "pass" ? 0 : 1
  
  unless @status == expected_status_code
    raise "Expected #{expected_status} but return code was #{@status}: #{@out}"
  end
  
  strip_duration(@out).should == expected_text
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
mattwynne-cucover-0.1.0 features/step_definitions/main_steps.rb
mattwynne-cucover-0.1.1 features/step_definitions/main_steps.rb