Sha256: 326c5a5c0373851b86d4f51d386754962cdaf246e03843ef210ff38e2f987c48

Contents?: true

Size: 1.02 KB

Versions: 7

Compression:

Stored size: 1.02 KB

Contents

# frozen_string_literal: true
When(/^I run rubycritic (.*)$/) do |args|
  rubycritic(args)
end

Then(/^the exit status indicates an error$/) do
  expect(last_command_started).to have_exit_status(RubyCritic::Command::StatusReporter::SCORE_BELOW_MINIMUM)
end

Then(/^the exit status indicates a success$/) do
  expect(last_command_started).to have_exit_status(RubyCritic::Command::StatusReporter::SUCCESS)
end

Then(/^it reports:$/) do |report|
  expect(last_command_started).to have_output_on_stdout(report.gsub('\n', "\n"))
end

Then(/^there is no output on stdout$/) do
  expect(last_command_started).to have_output_on_stdout('')
end

Then(/^it reports the current version$/) do
  expect(last_command_started).to have_output("RubyCritic #{RubyCritic::VERSION}\n")
end

Then(/^it reports the error ['"](.*)['"]$/) do |string|
  expect(last_command_started).to have_output_on_stderr(/#{Regexp.escape(string)}/)
end

Then(/^it succeeds$/) do
  expect(last_command_started).to have_exit_status(RubyCritic::Command::StatusReporter::SUCCESS)
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
rubycritic-3.2.0 features/step_definitions/rubycritic_steps.rb
rubycritic-3.1.3 features/step_definitions/rubycritic_steps.rb
rubycritic-3.1.2 features/step_definitions/rubycritic_steps.rb
rubycritic-3.1.1 features/step_definitions/rubycritic_steps.rb
rubycritic-3.1.0 features/step_definitions/rubycritic_steps.rb
rubycritic-3.0.0 features/step_definitions/rubycritic_steps.rb
rubycritic-2.9.4 features/step_definitions/rubycritic_steps.rb