Skip to content
This repository
Browse code

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
Eric Hodel drbrain authored
32 lib/heckle.rb
@@ -638,26 +638,30 @@ def rand_range
638 638 # Suppresses output on $stdout and $stderr.
639 639
640 640 def silence_stream
641   - dead = File.open("/dev/null", "w")
  641 + return yield if @@debug
642 642
643   - $stdout.flush
644   - $stderr.flush
  643 + begin
  644 + dead = File.open("/dev/null", "w")
645 645
646   - oldstdout = $stdout.dup
647   - oldstderr = $stderr.dup
  646 + $stdout.flush
  647 + $stderr.flush
648 648
649   - $stdout.reopen(dead)
650   - $stderr.reopen(dead)
  649 + oldstdout = $stdout.dup
  650 + oldstderr = $stderr.dup
651 651
652   - result = yield
  652 + $stdout.reopen(dead)
  653 + $stderr.reopen(dead)
653 654
654   - ensure
655   - $stdout.flush
656   - $stderr.flush
  655 + result = yield
  656 +
  657 + ensure
  658 + $stdout.flush
  659 + $stderr.flush
657 660
658   - $stdout.reopen(oldstdout)
659   - $stderr.reopen(oldstderr)
660   - result
  661 + $stdout.reopen(oldstdout)
  662 + $stderr.reopen(oldstderr)
  663 + result
  664 + end
661 665 end
662 666
663 667 class Reporter
2  lib/test_unit_heckler.rb
@@ -50,7 +50,7 @@ def self.validate(klass_name, method_name = nil,
50 50
51 51 passed = heckle.tests_pass?
52 52
53   - unless force and not passed then
  53 + unless force or passed then
54 54 abort "Initial run of tests failed... fix and run heckle again"
55 55 end
56 56
1  test/test_heckle.rb
@@ -112,6 +112,7 @@ def test_should_grab_mutatees_from_method
112 112 :dasgn => [], # no dasgns here
113 113 :dasgn_curr => [], # no dasgn_currs here
114 114 :iasgn => [], # no iasgns here
  115 + :iter => [],
115 116 :gasgn => [], # no gasgns here
116 117 :lasgn => [s(:lasgn, :i, s(:lit, 1)),
117 118 s(:lasgn, :i, s(:call, s(:lvar, :i), :+, s(:arglist, s(:lit, 1))))],

0 comments on commit dee274c

Please sign in to comment.
Something went wrong with that request. Please try again.