spec/guard/rails-assets_spec.rb in guard-rails-assets-0.0.3 vs spec/guard/rails-assets_spec.rb in guard-rails-assets-0.0.4
- old
+ new
@@ -19,9 +19,22 @@
describe '#run_on_change' do
it_behaves_like 'guard command', :command => :run_on_change, :run => true
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
def stub_system_with result
subject.should_receive(:system).with("bundle exec rake assets:clean assets:precompile").and_return result
end