Add some specs for Guard.start (just to ensure core methods are well called…)

This commit is contained in:
Rémy Coutable 2011-07-29 00:23:20 +02:00
parent 1481604411
commit 38067f447f
2 changed files with 17 additions and 0 deletions

1
spec/fixtures/Guardfile vendored Normal file
View File

@ -0,0 +1 @@
# nothing here, it's just for feeding the specs! :)

View File

@ -23,6 +23,11 @@ describe Guard do
::Guard.listener.should be_kind_of(Guard::Listener)
end
it "respect the watchdir option" do
::Guard.setup(:watchdir => "/foo/bar")
::Guard.listener.directory.should eql "/foo/bar"
end
it "turns on the notifier by default" do
ENV["GUARD_NOTIFY"] = nil
::Guard::Notifier.should_receive(:turn_on)
@ -40,6 +45,17 @@ describe Guard do
::Guard.setup(:notify => true)
end
end
describe ".start" do
it "basic check that core methods are called" do
opts = { :my_opts => true, :guardfile => File.join(@fixture_path, "Guardfile") }
::Guard.should_receive(:setup).with(opts)
::Guard::Dsl.should_receive(:evaluate_guardfile).with(opts)
::Guard.listener.should_receive(:start)
::Guard.start(opts)
end
end
describe ".get_guard_class" do
after do