Skip to content

Commit

Permalink
Merge pull request #350 from bfung/fix_uninitialized_constant_Guard_G…
Browse files Browse the repository at this point in the history
…uard_Compat

Fixes 'NameError: uninitialized constant Guard::Guard::Compat'.
  • Loading branch information
e2 committed Dec 29, 2015
2 parents 7f02d05 + b1eab34 commit 160f937
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 7 deletions.
2 changes: 1 addition & 1 deletion guard-rspec.gemspec
Expand Up @@ -10,7 +10,7 @@ Gem::Specification.new do |s|
s.email = "thibaud@thibaud.gg"
s.summary = "Guard gem for RSpec"
s.description = "Guard::RSpec automatically run your specs" +
" (much like autotest)."
" (much like autotest)."

s.homepage = "https://github.com/guard/guard-rspec"
s.license = "MIT"
Expand Down
2 changes: 1 addition & 1 deletion lib/guard/rspec.rb
Expand Up @@ -25,7 +25,7 @@ def initialize(options = {})
end

def start
Guard::Compat::UI.info "Guard::RSpec is running"
Compat::UI.info "Guard::RSpec is running"
run_all if options[:all_on_start]
end

Expand Down
2 changes: 1 addition & 1 deletion lib/guard/rspec/options.rb
Expand Up @@ -5,7 +5,7 @@ module Options
all_on_start: false,
all_after_pass: false,
run_all: { message: "Running all specs" },
failed_mode: :none, # :keep and :focus are other posibilities
failed_mode: :none, # :keep and :focus are other posibilities
spec_paths: %w(spec),
cmd: nil,
cmd_additional_args: nil,
Expand Down
6 changes: 3 additions & 3 deletions spec/lib/guard/rspec/notifier_spec.rb
Expand Up @@ -6,7 +6,7 @@
let(:options) { { notification: true, title: "RSpec results" } }
let(:notifier) { Guard::RSpec::Notifier.new(options) }

def expect_notification(title = "RSpec results", message, image, priority)
def expect_notification(message, image, priority, title = "RSpec results")
expect(Guard::Compat::UI).to receive(:notify).
with(message, title: title, image: image, priority: priority)
end
Expand All @@ -21,7 +21,7 @@ def expect_notification(title = "RSpec results", message, image, priority)
let(:options) { { notification: true, title: "Failure title" } }

it "notifies with the title" do
expect_notification("Failure title", "Failed", :failed, 2)
expect_notification("Failed", :failed, 2, "Failure title")
notifier.notify_failure
end
end
Expand Down Expand Up @@ -64,7 +64,7 @@ def expect_notification(title = "RSpec results", message, image, priority)
let(:options) { { notification: true, title: "Custom title" } }

it "notifies with the title" do
expect_notification("Custom title", "This is summary", :success, -2)
expect_notification("This is summary", :success, -2, "Custom title")
notifier.notify("This is summary")
end
end
Expand Down
3 changes: 2 additions & 1 deletion spec/lib/guard/rspec_formatter_spec.rb
Expand Up @@ -50,7 +50,8 @@ def rspec_summary_args(*args)

around do |example|
env_var = "GUARD_RSPEC_RESULTS_FILE"
old, ENV[env_var] = ENV[env_var], "foobar.txt"
old = ENV[env_var]
ENV[env_var] = "foobar.txt"
example.run
ENV[env_var] = old
end
Expand Down

0 comments on commit 160f937

Please sign in to comment.