From 2687809b7f1fc5cd306e441eb49fd9621265130e Mon Sep 17 00:00:00 2001 From: Cezary Baginski Date: Wed, 17 Dec 2014 14:22:44 +0100 Subject: [PATCH 1/2] reduce RSpec verbosity in Rakefile --- Rakefile | 7 ++++++- guard-cucumber.gemspec | 1 + 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/Rakefile b/Rakefile index 3e309cc..ef2bc3b 100644 --- a/Rakefile +++ b/Rakefile @@ -1,8 +1,13 @@ require "bundler" + +require 'nenv' Bundler::GemHelper.install_tasks require "rspec/core/rake_task" -RSpec::Core::RakeTask.new(:spec) +RSpec::Core::RakeTask.new(:spec) do |t| + t.verbose = Nenv.ci? +end + task default: :spec require "rbconfig" diff --git a/guard-cucumber.gemspec b/guard-cucumber.gemspec index 5a2129c..b7959fc 100644 --- a/guard-cucumber.gemspec +++ b/guard-cucumber.gemspec @@ -20,6 +20,7 @@ Gem::Specification.new do |s| s.add_dependency "guard", ">= 2.0.0" s.add_dependency "guard-compat", "~> 1.0" s.add_dependency "cucumber", ">= 1.3.0" + s.add_dependency "nenv", "~> 0.1" # NOTE: this is the :test group since gemspec(development_group: :test) is used s.add_development_dependency "bundler", "~> 1.1" From d50377cd10f17da8c36cddf786b83c299c3156d6 Mon Sep 17 00:00:00 2001 From: Cezary Baginski Date: Wed, 17 Dec 2014 14:56:03 +0100 Subject: [PATCH 2/2] fix requires and crashes --- lib/guard/cucumber/focuser.rb | 2 ++ lib/guard/cucumber/inspector.rb | 2 ++ lib/guard/cucumber/notification_formatter.rb | 10 +++++++++- lib/guard/cucumber/runner.rb | 4 ++++ spec/guard/cucumber/focuser_spec.rb | 2 ++ spec/guard/cucumber_spec.rb | 3 +++ spec/spec_helper.rb | 3 --- 7 files changed, 22 insertions(+), 4 deletions(-) diff --git a/lib/guard/cucumber/focuser.rb b/lib/guard/cucumber/focuser.rb index f2afa43..778735b 100644 --- a/lib/guard/cucumber/focuser.rb +++ b/lib/guard/cucumber/focuser.rb @@ -1,3 +1,5 @@ +require "guard/compat/plugin" + module Guard class Cucumber < Plugin # The Cucumber focuser updates cucumber feature paths to diff --git a/lib/guard/cucumber/inspector.rb b/lib/guard/cucumber/inspector.rb index a766809..c02d190 100644 --- a/lib/guard/cucumber/inspector.rb +++ b/lib/guard/cucumber/inspector.rb @@ -1,3 +1,5 @@ +require "guard/compat/plugin" + module Guard class Cucumber < Plugin # The inspector verifies of the changed paths are valid diff --git a/lib/guard/cucumber/notification_formatter.rb b/lib/guard/cucumber/notification_formatter.rb index 4c98208..7af5bdf 100644 --- a/lib/guard/cucumber/notification_formatter.rb +++ b/lib/guard/cucumber/notification_formatter.rb @@ -1,3 +1,10 @@ +# Conditionally require this because it's run outside Guard +# TODO: MOVE THIS OUTSIDE THE FORMATTER!!!! +require "guard/notifier" + +require "cucumber" +require "guard/compat/plugin" + require "cucumber/formatter/console" require "cucumber/formatter/io" @@ -69,7 +76,7 @@ def after_feature_element(feature_element) def step_name(_keyword, step_match, status, _src_indent, _bckgnd, _loc) return unless [:failed, :pending, :undefined].index(status) - #TODO: "NO COVERATE HERE!!" + # TODO: NO COVERAGE HERE! @rerun = true step_name = step_match.format_args(lambda { |param| "*#{ param }*" }) @@ -83,6 +90,7 @@ def step_name(_keyword, step_match, status, _src_indent, _bckgnd, _loc) # result of the feature tests. # def notify_summary + # TODO: MOVE THIS OUTSIDE THE FORMATTER!!!! statuses = [:failed, :skipped, :undefined, :pending, :passed] statuses = statuses.reverse statuses.select! { |status| step_mother.steps(status).any? } diff --git a/lib/guard/cucumber/runner.rb b/lib/guard/cucumber/runner.rb index 9187e4e..9f78e7b 100644 --- a/lib/guard/cucumber/runner.rb +++ b/lib/guard/cucumber/runner.rb @@ -1,3 +1,7 @@ +require "guard/compat/plugin" + +require "guard/cucumber/focuser" + module Guard class Cucumber < Plugin # The Cucumber runner handles the execution of the cucumber binary. diff --git a/spec/guard/cucumber/focuser_spec.rb b/spec/guard/cucumber/focuser_spec.rb index c658203..d46e015 100644 --- a/spec/guard/cucumber/focuser_spec.rb +++ b/spec/guard/cucumber/focuser_spec.rb @@ -1,3 +1,5 @@ +require "guard/compat/test/helper" + require "guard/cucumber/focuser" RSpec.describe Guard::Cucumber::Focuser do diff --git a/spec/guard/cucumber_spec.rb b/spec/guard/cucumber_spec.rb index 798a674..a963e92 100644 --- a/spec/guard/cucumber_spec.rb +++ b/spec/guard/cucumber_spec.rb @@ -1,3 +1,6 @@ +require "guard/compat/test/helper" +require "guard/cucumber" + RSpec.describe Guard::Cucumber do subject { Guard::Cucumber.new(options) } diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 4e77284..dc3d5b0 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -1,6 +1,3 @@ -require "guard/compat/test/helper" -require "guard/cucumber" - # This file was generated by the `rspec --init` command. Conventionally, all # specs live under a `spec` directory, which RSpec adds to the `$LOAD_PATH`. # The generated `.rspec` file contains `--require spec_helper` which will cause