master/spec/guard/interactor_spec.rb
Rémy Coutable eb347ee266 Merge branch 'master' into hook
Conflicts:
	Gemfile
	Guardfile
	README.markdown
	Rakefile
	lib/guard.rb
	lib/guard/dsl.rb
	lib/guard/interactor.rb
	lib/guard/listener.rb
	lib/guard/ui.rb
	lib/guard/watcher.rb
	spec/guard/dsl_spec.rb
	spec/guard/notifier_spec.rb
2011-08-17 01:34:27 +02:00

36 lines
789 B
Ruby

require 'spec_helper'
describe Guard::Interactor do
subject { Guard::Interactor }
let(:guard) { mock "guard" }
before :each do
Guard.stub!(:guards).and_return([guard])
Guard.stub!(:options).and_return({})
Guard.stub!(:listener).and_return(mock(:start => nil, :stop => nil))
guard.should_receive(:hook).twice
end
describe ".run_all" do
it "sends :run_all to all guards" do
guard.should_receive(:run_all)
subject.run_all
end
end
describe ".stop" do
it "sends :stop to all guards" do
guard.should_receive(:stop)
lambda { subject.stop }.should raise_error(SystemExit)
end
end
describe ".reload" do
it "sends :reload to all guards" do
guard.should_receive(:reload)
subject.reload
end
end
end