added specs, fix #3

This commit is contained in:
Dmytrii Nagirniak 2011-07-16 18:54:35 +10:00
parent 96ba8c7b31
commit b099920faf
2 changed files with 13 additions and 2 deletions

View File

@ -34,8 +34,6 @@ module Guard
end end
end end
private
def run_for? command def run_for? command
run_on = @options[:run_on] run_on = @options[:run_on]
run_on = [:start, :change] if not run_on or run_on.to_s.empty? run_on = [:start, :change] if not run_on or run_on.to_s.empty?

View File

@ -21,6 +21,19 @@ describe Guard::RailsAssets do
it_behaves_like 'guard command', :command => :run_on_change, :run => true it_behaves_like 'guard command', :command => :run_on_change, :run => true
end end
describe 'run options' do
it 'should allow array of symbols' do
guard = Guard::RailsAssets.new(['watchers'], :run_on => [:start, :change])
guard.run_for?(:start).should be_true
guard.run_for?(:reload).should be_false
end
it 'should allow symbol' do
guard = Guard::RailsAssets.new(['watchers'], :run_on => :start)
guard.run_for?(:start).should be_true
guard.run_for?(:reload).should be_false
end
end
describe 'asset compilation using CLI' do describe 'asset compilation using CLI' do
def stub_system_with result def stub_system_with result