2011-05-06 17:29:24 +00:00
|
|
|
require 'spec_helper'
|
|
|
|
|
|
|
|
describe Guard::Interactor do
|
2011-09-01 21:24:45 +00:00
|
|
|
subject { Guard::Interactor.new }
|
2011-05-13 09:26:05 +00:00
|
|
|
|
2011-09-01 21:24:45 +00:00
|
|
|
describe "#initialize" do
|
2011-09-20 22:34:11 +00:00
|
|
|
it "unlocks the interactor by default" do
|
2011-09-01 21:24:45 +00:00
|
|
|
subject.locked.should be_false
|
2011-05-13 09:26:05 +00:00
|
|
|
end
|
2011-05-06 17:29:24 +00:00
|
|
|
end
|
|
|
|
|
2011-09-01 21:24:45 +00:00
|
|
|
describe "#lock" do
|
2011-09-20 22:34:11 +00:00
|
|
|
it "locks the interactor" do
|
|
|
|
subject.start
|
2011-09-01 21:24:45 +00:00
|
|
|
subject.lock
|
|
|
|
subject.locked.should be_true
|
2011-05-13 09:26:05 +00:00
|
|
|
end
|
2011-05-06 17:29:24 +00:00
|
|
|
end
|
|
|
|
|
2011-09-01 21:24:45 +00:00
|
|
|
describe "#unlock" do
|
2011-09-20 22:34:11 +00:00
|
|
|
it "unlocks the interactor" do
|
|
|
|
subject.start
|
2011-09-01 21:24:45 +00:00
|
|
|
subject.unlock
|
|
|
|
subject.locked.should be_false
|
2011-05-13 09:26:05 +00:00
|
|
|
end
|
2011-05-06 17:29:24 +00:00
|
|
|
end
|
2011-09-01 21:24:45 +00:00
|
|
|
|
2011-05-06 17:29:24 +00:00
|
|
|
end
|