Skip to content

Commit

Permalink
Proper restore environment for interactor specs.
Browse files Browse the repository at this point in the history
  • Loading branch information
netzpirat committed Nov 12, 2012
1 parent 2cf617b commit 3843ebd
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion spec/guard_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,13 @@

describe ".setup_interactor" do
context 'with CLI options' do
before do
@enabled = ::Guard::Interactor.enabled
::Guard::Interactor.enabled = true
end

after { ::Guard::Interactor.enabled = @enabled }

context "with interactions enabled" do
before { ::Guard.setup(:no_interactions => false) }

Expand All @@ -283,8 +290,12 @@
end

context 'with DSL options' do
before { @enabled = ::Guard::Interactor.enabled }
after { ::Guard::Interactor.enabled = @enabled }

context "with interactions enabled" do
before do
::Guard::Interactor.enabled = true
::Guard.setup()
end

Expand All @@ -293,7 +304,8 @@

context "with interactions disabled" do
before do
::Guard.setup(:guardfile_contents => "interactor :off")
::Guard::Interactor.enabled = false
::Guard.setup()
end

it_should_behave_like 'interactor disabled'
Expand Down

0 comments on commit 3843ebd

Please sign in to comment.