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)
|
::Guard.listener.should be_kind_of(Guard::Listener)
|
||||||
end
|
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
|
it "turns on the notifier by default" do
|
||||||
ENV["GUARD_NOTIFY"] = nil
|
ENV["GUARD_NOTIFY"] = nil
|
||||||
::Guard::Notifier.should_receive(:turn_on)
|
::Guard::Notifier.should_receive(:turn_on)
|
||||||
@ -41,6 +46,17 @@ describe Guard do
|
|||||||
end
|
end
|
||||||
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
|
describe ".get_guard_class" do
|
||||||
after do
|
after do
|
||||||
[:Classname, :DashedClassName, :Inline].each do |const|
|
[:Classname, :DashedClassName, :Inline].each do |const|
|
||||||
|
Loading…
Reference in New Issue
Block a user