Navigation Menu

Skip to content
This repository has been archived by the owner on Jun 8, 2019. It is now read-only.

Commit

Permalink
Remove some more subject stubbing
Browse files Browse the repository at this point in the history
  • Loading branch information
Gabe Berke-Williams committed Sep 11, 2011
1 parent 5b66e24 commit 30e0b3e
Showing 1 changed file with 22 additions and 6 deletions.
28 changes: 22 additions & 6 deletions spec/kumade/git_spec.rb
Expand Up @@ -84,15 +84,31 @@
end end


describe Kumade::Git, "#dirty?" do describe Kumade::Git, "#dirty?" do
it "returns true when dirty" do context "when dirty" do
subject.should_receive(:run).with("git diff --exit-code").and_return(false) let(:command_line) { mock("CommandLine instance") }


subject.should be_dirty before do
command_line.should_receive(:run).and_raise(Cocaine::ExitStatusError)

Cocaine::CommandLine.should_receive(:new).
with("git diff --exit-code").
and_return(command_line)
end

it "returns true" do
subject.dirty?.should == true
end
end end


it "returns false when not dirty" do context "when clean" do
subject.should_receive(:run).with("git diff --exit-code").and_return(true) before do
Cocaine::CommandLine.should_receive(:new).
with("git diff --exit-code").
and_return(mock(:run => true))
end


subject.should_not be_dirty it "returns false" do
subject.dirty?.should == false
end
end end
end end

0 comments on commit 30e0b3e

Please sign in to comment.