Permalink
Browse files

Clean up some cruft I accidentally left in threshold spec.

  • Loading branch information...
1 parent 40f5083 commit 38cb79b8a821fb0bbf3aa953ed374080a0521c65 @xaviershay xaviershay committed Jan 14, 2013
Showing with 5 additions and 9 deletions.
  1. +5 −9 spec/threshold_check_spec.rb
@@ -6,20 +6,20 @@
context "checking violations" do
- def check(opts = {})
- Cane::ThresholdCheck.new(opts)
+ def run(threshold, value)
+ described_class.new(threshold => [['x', value]])
end
context "when the current coverage cannot be read" do
it do
- check(gte: [['bogus_file', '20']]).should \
- have_violation('bogus_file is unavailable, should be >= 20.0')
+ run(:gte, 20).should \
+ have_violation('x is unavailable, should be >= 20.0')
end
end
context "when the coverage threshold is incorrectly specified" do
it do
- check(gte: [['20', 'bogus_file']]).should \
+ described_class.new(gte: [['20', 'bogus_file']]).should \
have_violation('bogus_file is not a number or a file')
end
end
@@ -31,10 +31,6 @@ def check(opts = {})
file.should_receive(:contents).with('x').and_return("8\n")
end
- def run(threshold, value)
- check(threshold => [['x', value]])
- end
-
context '>' do
it { run(:gt, 7).should have_no_violations }
it { run(:gt, 8).should have_violation('x is 8.0, should be > 8.0') }

0 comments on commit 38cb79b

Please sign in to comment.