Skip to content

Commit

Permalink
fix requires and crashes
Browse files Browse the repository at this point in the history
  • Loading branch information
e2 committed Dec 17, 2014
1 parent 2687809 commit d50377c
Show file tree
Hide file tree
Showing 7 changed files with 22 additions and 4 deletions.
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 d50377c

Please sign in to comment.