Skip to content

Commit

Permalink
+ Switched to minitest 5!
Browse files Browse the repository at this point in the history
[git-p4: depot-paths = "//src/minitest-debugger/dev/": change = 8623]
  • Loading branch information
zenspider committed May 29, 2013
1 parent df287c2 commit 00406c8
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 8 deletions.
2 changes: 1 addition & 1 deletion Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Hoe.spec "minitest-debugger" do

self.rubyforge_name = "seattlerb"

dependency "minitest", "~> 4.0"
dependency "minitest", "~> 5.0"
end

# vim: syntax=ruby
4 changes: 2 additions & 2 deletions example.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# require 'minitest/debugger'
require 'minitest/debugger' if ENV["MTDB"]
require 'minitest/autorun'

class TestMiniTestUnitTestCase < MiniTest::Unit::TestCase
class TestMiniTestUnitTestCase < Minitest::Test
def good
42
end
Expand Down
11 changes: 6 additions & 5 deletions lib/minitest/debugger.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,27 +19,28 @@ def set_trace_func(*args)
SCRIPT_LINES__[__FILE__] = File.readlines(__FILE__)

require 'debug'
require "minitest/unit"
require "minitest"
require "minitest/test"

##
# This is a stupid simple example of how easy it is to make a minitest
# plugin that does something useful. In this case it wraps assert so
# that failed assertions will drop into the ruby debugger.

module MiniTest::Debugger
module Minitest::Debugger
VERSION = "1.0.1"

def assert test, msg = nil
begin
super
rescue MiniTest::Assertion => e
rescue Minitest::Assertion => e
warn "Assertion Failed. Dropping into debugger now:"
DEBUGGER__.interrupt
raise e
end
end
end

class MiniTest::Unit::TestCase
include MiniTest::Debugger
class Minitest::Test
include Minitest::Debugger
end

0 comments on commit 00406c8

Please sign in to comment.