Skip to content

Commit

Permalink
Avoid warnings due to multiple calls to configure
Browse files Browse the repository at this point in the history
I was seeing multiple warnings like the following in the spec output:

    W, [2019-08-07T11:42:43.494699 #48484]  WARN -- : Adapter already configured!

This was because in the Adapter::Darwin spec in the "running threads"
describe block, both `subject.configure` and `subject.start` were being
called and the latter calls the former.

By moving the call to `subject.configure` into the "configuration"
describe block, we can avoid this problem.
  • Loading branch information
floehopper committed Aug 7, 2019
1 parent 6e1b143 commit 086b785
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion spec/lib/listen/adapter/darwin_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -89,10 +89,13 @@
expectations.each do |dir, obj|
allow(obj).to receive(:watch).with(dir.to_s, latency: 0.1)
end
subject.configure
end

describe 'configuration' do
before do
subject.configure
end

context 'with 1 directory' do
let(:directories) { expectations.keys.map { |p| Pathname(p.to_s) } }

Expand Down

0 comments on commit 086b785

Please sign in to comment.