Sha256: a22f3072d7dd47a8abc6df925f4df698ad604a0f3317839867de0b2baa95b7c0

Contents?: true

Size: 699 Bytes

Versions: 1

Compression:

Stored size: 699 Bytes

Contents

require 'tempfile'

Given(/^a file named "(.*?)" with:$/) do |filename, content|
  write_test_file(filename, content)
end

When(/^I run `rspec.*?(\S+)`$/) do |filename|
  path = path_for(filename)
  @output = `ruby #{path}`
end

Then(/^the output should contain:$/) do |content|
  assert_includes @output, content
end

Then(/^the output should contain "(.*?)"$/) do |content|
  # 1 runs, 0 assertions, 0 failures, 0 errors, 0 skips
  runs = $1 if content =~ /(\d+) examples?/
  failures = $1 if content =~ /(\d+) failures?/
  skips = $1 if content =~ /(\d+) pending/
  content = /#{runs} runs, \d+ assertions, #{failures} failures, 0 errors, #{skips || 0} skips/
  assert_match content, @output
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
minitest-around-0.3.1 features/step_definitions/around_steps.rb