Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Tighten up specs a bit

  • Loading branch information...
commit 69637404814bd51508ddb355d2e821d8decfdba8 1 parent 6835fc1
@brynary brynary authored
Showing with 4 additions and 2 deletions.
  1. +1 −1  spec/ops/hostname_spec.rb
  2. +3 −1 spec/ops/revision_spec.rb
View
2  spec/ops/hostname_spec.rb
@@ -3,7 +3,7 @@
describe E20::Ops::Hostname do
it "returns the hostname" do
hostname = E20::Ops::Hostname.new
- hostname.stub(:` => "Computer.local\n")
+ hostname.should_receive(:`).with("hostname").and_return("Computer.local\n")
hostname.to_s.should == "Computer.local"
end
end
View
4 spec/ops/revision_spec.rb
@@ -11,7 +11,9 @@
context "when a REVISION file is not present" do
it "adds a X-Revision header with the git rev-parse HEAD" do
- E20::Ops::Revision.new.to_s.should == `git rev-parse HEAD`.strip
+ revision = E20::Ops::Revision.new
+ revision.should_receive(:`).with("git rev-parse HEAD").and_return("abc123")
+ revision.to_s.should == "abc123"
end
end
Please sign in to comment.
Something went wrong with that request. Please try again.