diff --git a/spec/fixtures/Guardfile b/spec/fixtures/Guardfile new file mode 100644 index 0000000..0b786e3 --- /dev/null +++ b/spec/fixtures/Guardfile @@ -0,0 +1 @@ +# nothing here, it's just for feeding the specs! :) \ No newline at end of file diff --git a/spec/guard_spec.rb b/spec/guard_spec.rb index b8c1c43..479b09e 100644 --- a/spec/guard_spec.rb +++ b/spec/guard_spec.rb @@ -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