don't run on change if paths are empty
This commit is contained in:
parent
26326b5c32
commit
8497977cac
24
Rakefile
24
Rakefile
|
@ -6,3 +6,27 @@ task :push_everywhere do
|
|||
system %{git push origin master}
|
||||
system %{git push guard master}
|
||||
end
|
||||
|
||||
namespace :spec do
|
||||
desc "Run on three Rubies"
|
||||
task :platforms do
|
||||
current = %x{rvm-prompt v}
|
||||
|
||||
fail = false
|
||||
%w{1.8.7 1.9.2 ree}.each do |version|
|
||||
puts "Switching to #{version}"
|
||||
system %{rvm #{version}}
|
||||
system %{bundle exec rspec spec}
|
||||
if $?.exitstatus != 0
|
||||
fail = true
|
||||
break
|
||||
end
|
||||
end
|
||||
|
||||
system %{rvm #{current}}
|
||||
|
||||
exit (fail ? 1 : 0)
|
||||
end
|
||||
end
|
||||
|
||||
task :default => 'spec:platforms'
|
||||
|
|
|
@ -26,7 +26,11 @@ module Guard
|
|||
@ran_jammit = false
|
||||
if run_before and run_jammit
|
||||
@ran_jammit = true
|
||||
run_all if JasmineHeadlessWebkitRunner.run(paths) == 0
|
||||
do_run_all = true
|
||||
if !paths.empty?
|
||||
do_run_all = (JasmineHeadlessWebkitRunner.run(paths) == 0)
|
||||
end
|
||||
run_all if do_run_all
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
@ -44,6 +44,15 @@ describe Guard::JasmineHeadlessWebkit do
|
|||
guard.run_on_change(%w{test})
|
||||
end
|
||||
end
|
||||
|
||||
context 'no files given, just run all' do
|
||||
it 'should run all but not run once' do
|
||||
Guard::JasmineHeadlessWebkitRunner.expects(:run).never
|
||||
guard.expects(:run_all).once
|
||||
|
||||
guard.run_on_change([])
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
context 'with run_before' do
|
||||
|
@ -97,7 +106,7 @@ describe Guard::JasmineHeadlessWebkit do
|
|||
let(:options) { { :jammit => true } }
|
||||
|
||||
it "should run jammit only once" do
|
||||
guard.run_on_change([])
|
||||
guard.run_on_change(%w{path.txt})
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue