Permalink
Browse files

Fix tests for UI broken after updating Bundler message

  • Loading branch information...
1 parent 40b257b commit 2465e8d25b87708d929598998433122824284821 @mcmire committed Apr 13, 2012
Showing with 17 additions and 15 deletions.
  1. +17 −15 spec/guard/cli_spec.rb
@@ -27,7 +27,7 @@
after { ENV['BUNDLE_GEMFILE'] = @bundler_env }
it 'does not show the Bundler warning' do
- ui.should_not_receive(:warning).with("You are using Guard outside of Bundler, this is dangerous and may not work. Using `bundle exec guard` is safer.")
+ ui.should_not_receive(:info).with(/you are running\n`guard` outside of Bundler/i)
subject.start
end
end
@@ -41,12 +41,12 @@
after { ENV['BUNDLE_GEMFILE'] = @bundler_env }
it 'does show the Bundler warning' do
- ui.should_receive(:warning).with("You are using Guard outside of Bundler, this is dangerous and may not work. Using `bundle exec guard` is safer.")
+ ui.should_receive(:info).with(/you are running\n`guard` outside of Bundler/i)
subject.start
end
it 'does not show the Bundler warning with the :no_bundler_warning flag' do
- ui.should_not_receive(:warning).with("You are using Guard outside of Bundler, this is dangerous and may not work. Using `bundle exec guard` is safer.")
+ ui.should_not_receive(:info).with(/you are running\n`guard` outside of Bundler/i)
subject.options = { :no_bundler_warning => true }
subject.start
end
@@ -63,7 +63,7 @@
after { ENV['BUNDLE_GEMFILE'] = @bundler_env }
it 'does not show the Bundler warning' do
- ui.should_not_receive(:warning).with("You are using Guard outside of Bundler, this is dangerous and may not work. Using `bundle exec guard` is safer.")
+ ui.should_not_receive(:info).with(/you are running\n`guard` outside of Bundler/i)
subject.start
end
end
@@ -109,7 +109,7 @@
after { ENV['BUNDLE_GEMFILE'] = @bundler_env }
it 'does not show the Bundler warning' do
- ui.should_not_receive(:warning).with("You are using Guard outside of Bundler, this is dangerous and may not work. Using `bundle exec guard` is safer.")
+ ui.should_not_receive(:info).with(/you are running\n`guard` outside of Bundler/i)
subject.list
end
end
@@ -122,14 +122,16 @@
after { ENV['BUNDLE_GEMFILE'] = @bundler_env }
- it 'does not show the Bundler warning' do
- ui.should_receive(:warning).with("You are using Guard outside of Bundler, this is dangerous and may not work. Using `bundle exec guard` is safer.")
+ it 'shows the Bundler warning' do
+ ui.should_receive(:info).with(/you are running\n`guard` outside of Bundler/i)
subject.list
end
end
end
describe '#version' do
+ before { ui.stub(:info) }
+
it 'shows the current version' do
ui.should_receive(:info).with(/#{ ::Guard::VERSION }/)
subject.version
@@ -144,7 +146,7 @@
after { ENV['BUNDLE_GEMFILE'] = @bundler_env }
it 'does not show the Bundler warning' do
- ui.should_not_receive(:warning).with("You are using Guard outside of Bundler, this is dangerous and may not work. Using `bundle exec guard` is safer.")
+ ui.should_not_receive(:info).with(/you are running\n`guard` outside of Bundler/i)
subject.version
end
end
@@ -157,8 +159,8 @@
after { ENV['BUNDLE_GEMFILE'] = @bundler_env }
- it 'does not show the Bundler warning' do
- ui.should_receive(:warning).with("You are using Guard outside of Bundler, this is dangerous and may not work. Using `bundle exec guard` is safer.")
+ it 'shows the Bundler warning' do
+ ui.should_receive(:info).with(/you are running\n`guard` outside of Bundler/i).once
subject.version
end
end
@@ -211,7 +213,7 @@
after { ENV['BUNDLE_GEMFILE'] = @bundler_env }
it 'does not show the Bundler warning' do
- ui.should_not_receive(:warning).with("You are using Guard outside of Bundler, this is dangerous and may not work. Using `bundle exec guard` is safer.")
+ ui.should_not_receive(:info).with(/you are running\n`guard` outside of Bundler/i)
subject.init
end
end
@@ -224,8 +226,8 @@
after { ENV['BUNDLE_GEMFILE'] = @bundler_env }
- it 'does not show the Bundler warning' do
- ui.should_receive(:warning).with("You are using Guard outside of Bundler, this is dangerous and may not work. Using `bundle exec guard` is safer.")
+ it 'shows the Bundler warning' do
+ ui.should_receive(:info).with(/you are running\n`guard` outside of Bundler/i)
subject.init
end
end
@@ -248,7 +250,7 @@
after { ENV['BUNDLE_GEMFILE'] = @bundler_env }
it 'does not show the Bundler warning' do
- ui.should_not_receive(:warning).with("You are using Guard outside of Bundler, this is dangerous and may not work. Using `bundle exec guard` is safer.")
+ ui.should_not_receive(:info).with(/you are running\n`guard` outside of Bundler/i)
subject.show
end
end
@@ -262,7 +264,7 @@
after { ENV['BUNDLE_GEMFILE'] = @bundler_env }
it 'does not show the Bundler warning' do
- ui.should_receive(:warning).with("You are using Guard outside of Bundler, this is dangerous and may not work. Using `bundle exec guard` is safer.")
+ ui.should_receive(:info).with(/you are running\n`guard` outside of Bundler/i)
subject.show
end
end

0 comments on commit 2465e8d

Please sign in to comment.