Skip to content

Commit

Permalink
Merge pull request #18 from guard/fix_cucumber_requires
Browse files Browse the repository at this point in the history
fix crashes due to missing/wrong requires
  • Loading branch information
e2 committed Dec 17, 2014
2 parents 2b4c042 + d50377c commit 75dc451
Show file tree
Hide file tree
Showing 9 changed files with 29 additions and 5 deletions.
7 changes: 6 additions & 1 deletion Rakefile
Original file line number Diff line number Diff line change
@@ -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"
Expand Down
1 change: 1 addition & 0 deletions guard-cucumber.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 2 additions & 0 deletions lib/guard/cucumber/focuser.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
require "guard/compat/plugin"

module Guard
class Cucumber < Plugin
# The Cucumber focuser updates cucumber feature paths to
Expand Down
2 changes: 2 additions & 0 deletions lib/guard/cucumber/inspector.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
require "guard/compat/plugin"

module Guard
class Cucumber < Plugin
# The inspector verifies of the changed paths are valid
Expand Down
10 changes: 9 additions & 1 deletion lib/guard/cucumber/notification_formatter.rb
Original file line number Diff line number Diff line change
@@ -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"

Expand Down Expand Up @@ -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 }*" })

Expand All @@ -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? }
Expand Down
4 changes: 4 additions & 0 deletions lib/guard/cucumber/runner.rb
Original file line number Diff line number Diff line change
@@ -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.
Expand Down
2 changes: 2 additions & 0 deletions spec/guard/cucumber/focuser_spec.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
require "guard/compat/test/helper"

require "guard/cucumber/focuser"

RSpec.describe Guard::Cucumber::Focuser do
Expand Down
3 changes: 3 additions & 0 deletions spec/guard/cucumber_spec.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
require "guard/compat/test/helper"
require "guard/cucumber"

RSpec.describe Guard::Cucumber do
subject { Guard::Cucumber.new(options) }

Expand Down
3 changes: 0 additions & 3 deletions spec/spec_helper.rb
Original file line number Diff line number Diff line change
@@ -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
Expand Down

0 comments on commit 75dc451

Please sign in to comment.