From b1eab34d600372e1c8d9eebe2ca999e7aaa00396 Mon Sep 17 00:00:00 2001 From: Benson Fung Date: Sat, 26 Dec 2015 04:24:12 -0800 Subject: [PATCH] Fixes 'NameError: uninitialized constant Guard::Guard::Compat'. --- guard-rspec.gemspec | 2 +- lib/guard/rspec.rb | 2 +- lib/guard/rspec/options.rb | 2 +- spec/lib/guard/rspec/notifier_spec.rb | 6 +++--- spec/lib/guard/rspec_formatter_spec.rb | 3 ++- 5 files changed, 8 insertions(+), 7 deletions(-) diff --git a/guard-rspec.gemspec b/guard-rspec.gemspec index 6f36ce38..436584ec 100644 --- a/guard-rspec.gemspec +++ b/guard-rspec.gemspec @@ -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" diff --git a/lib/guard/rspec.rb b/lib/guard/rspec.rb index afbd0e43..39c4c8ad 100644 --- a/lib/guard/rspec.rb +++ b/lib/guard/rspec.rb @@ -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 diff --git a/lib/guard/rspec/options.rb b/lib/guard/rspec/options.rb index a1da6cee..32206190 100644 --- a/lib/guard/rspec/options.rb +++ b/lib/guard/rspec/options.rb @@ -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, diff --git a/spec/lib/guard/rspec/notifier_spec.rb b/spec/lib/guard/rspec/notifier_spec.rb index 8fa1b31f..41a952f1 100644 --- a/spec/lib/guard/rspec/notifier_spec.rb +++ b/spec/lib/guard/rspec/notifier_spec.rb @@ -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 @@ -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 @@ -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 diff --git a/spec/lib/guard/rspec_formatter_spec.rb b/spec/lib/guard/rspec_formatter_spec.rb index bf11bbcb..aa82d2c7 100644 --- a/spec/lib/guard/rspec_formatter_spec.rb +++ b/spec/lib/guard/rspec_formatter_spec.rb @@ -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