Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Make -v more useful.

Fix moronic bug with passed/force.
Fix tests for iter changes.

[git-p4: depot-paths = "//src/heckle/dev/": change = 3557]
  • Loading branch information...
commit dee274c7385416340eb8b49f76b1ff08247ce338 1 parent 7d58704
@drbrain drbrain authored
Showing with 20 additions and 15 deletions.
  1. +18 −14 lib/heckle.rb
  2. +1 −1  lib/test_unit_heckler.rb
  3. +1 −0  test/test_heckle.rb
View
32 lib/heckle.rb
@@ -638,26 +638,30 @@ def rand_range
# Suppresses output on $stdout and $stderr.
def silence_stream
- dead = File.open("/dev/null", "w")
+ return yield if @@debug
- $stdout.flush
- $stderr.flush
+ begin
+ dead = File.open("/dev/null", "w")
- oldstdout = $stdout.dup
- oldstderr = $stderr.dup
+ $stdout.flush
+ $stderr.flush
- $stdout.reopen(dead)
- $stderr.reopen(dead)
+ oldstdout = $stdout.dup
+ oldstderr = $stderr.dup
- result = yield
+ $stdout.reopen(dead)
+ $stderr.reopen(dead)
- ensure
- $stdout.flush
- $stderr.flush
+ result = yield
+
+ ensure
+ $stdout.flush
+ $stderr.flush
- $stdout.reopen(oldstdout)
- $stderr.reopen(oldstderr)
- result
+ $stdout.reopen(oldstdout)
+ $stderr.reopen(oldstderr)
+ result
+ end
end
class Reporter
View
2  lib/test_unit_heckler.rb
@@ -50,7 +50,7 @@ def self.validate(klass_name, method_name = nil,
passed = heckle.tests_pass?
- unless force and not passed then
+ unless force or passed then
abort "Initial run of tests failed... fix and run heckle again"
end
View
1  test/test_heckle.rb
@@ -112,6 +112,7 @@ def test_should_grab_mutatees_from_method
:dasgn => [], # no dasgns here
:dasgn_curr => [], # no dasgn_currs here
:iasgn => [], # no iasgns here
+ :iter => [],
:gasgn => [], # no gasgns here
:lasgn => [s(:lasgn, :i, s(:lit, 1)),
s(:lasgn, :i, s(:call, s(:lvar, :i), :+, s(:arglist, s(:lit, 1))))],
Please sign in to comment.
Something went wrong with that request. Please try again.