Add some specs for Guard.start (just to ensure core methods are well called…)
This commit is contained in:
parent
1481604411
commit
38067f447f
1
spec/fixtures/Guardfile
vendored
Normal file
1
spec/fixtures/Guardfile
vendored
Normal file
@ -0,0 +1 @@
|
||||
# nothing here, it's just for feeding the specs! :)
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user