Don't kill listener thread on spec
This commit is contained in:
parent
b0295c1437
commit
ee5468eeeb
@ -158,29 +158,29 @@ describe Guard::Listener do
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
describe "#ignore_paths" do
|
||||
it "defaults to the default ignore paths" do
|
||||
subject.new.ignore_paths.should == Guard::Listener::DefaultIgnorePaths
|
||||
end
|
||||
|
||||
|
||||
it "can be added to via :ignore_paths option" do
|
||||
listener = subject.new 'path', :ignore_paths => ['foo', 'bar']
|
||||
listener.ignore_paths.should include('foo', 'bar')
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
describe "#exclude_ignored_paths [<dirs>]" do
|
||||
let(:ignore_paths) { nil }
|
||||
subject { described_class.new(@fixture_path, {:ignore_paths => ignore_paths}) }
|
||||
|
||||
|
||||
it "returns children of <dirs>" do
|
||||
subject.exclude_ignored_paths(["spec/fixtures"]).should =~ ["spec/fixtures/.dotfile", "spec/fixtures/folder1", "spec/fixtures/Guardfile"]
|
||||
end
|
||||
|
||||
|
||||
describe "when ignore_paths set to some of <dirs> children" do
|
||||
let(:ignore_paths) { ['Guardfile', '.dotfile'] }
|
||||
|
||||
|
||||
it "excludes the ignored paths" do
|
||||
subject.exclude_ignored_paths(["spec/fixtures"]).should =~ ["spec/fixtures/folder1"]
|
||||
end
|
||||
|
@ -3,7 +3,7 @@ private
|
||||
def start(rest_delay = @rest_delay)
|
||||
sleep(rest_delay || 1)
|
||||
@listener.update_last_event
|
||||
@thread = Thread.new { @listener.start }
|
||||
Thread.new { @listener.start }
|
||||
sleep(rest_delay || 1)
|
||||
end
|
||||
|
||||
@ -19,7 +19,6 @@ private
|
||||
def stop(rest_delay = @rest_delay)
|
||||
sleep(rest_delay || 1)
|
||||
@listener.stop
|
||||
Thread.kill(@thread)
|
||||
sleep(rest_delay || 1)
|
||||
end
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user