Skip to content
This repository has been archived by the owner on May 22, 2021. It is now read-only.

Commit

Permalink
modify for ruby-1.9.2
Browse files Browse the repository at this point in the history
  • Loading branch information
kachick committed Aug 26, 2012
1 parent 07d6142 commit 6804719
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 1 deletion.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,4 @@ doc/

# other
*.lock
.rbx
1 change: 1 addition & 0 deletions Manifest.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ test-declare.gemspec
lib/test/declare.rb
lib/test/declare/requirements.rb
lib/test/declare/version.rb
lib/test/declare/compatible_ruby_version.rb
lib/test/declare/exceptions.rb
lib/test/declare/assertions.rb
lib/test/declare/singleton_class.rb
Expand Down
3 changes: 2 additions & 1 deletion lib/test/declare/assertions.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ module Test; module Declare

module Assertions

UNASSIGNED = Test::Unit::TestCase::UNASSIGNED
UNASSIGNED = Test::Unit::TestCase.const_defined?(:UNASSIGNED) ?
Test::Unit::TestCase::UNASSIGNED : ''

def is(other, desc=nil)
target = it
Expand Down
20 changes: 20 additions & 0 deletions lib/test/declare/compatible_ruby_version.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
require 'test/unit'

unless RUBY_VERSION >= '1.9.3'

module MiniTest; class Unit; class TestCase

class << self

remove_method :test_suites

# This code from 1.9.3's minitest
def test_suites # :nodoc:
@@test_suites.keys.sort_by { |ts| ts.name.to_s }
end

end

end; end; end

end
1 change: 1 addition & 0 deletions lib/test/declare/requirements.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
require_relative 'version'
require_relative 'compatible_ruby_version'
require_relative 'exceptions'
require_relative 'assertions'
require_relative 'singleton_class'
Expand Down

0 comments on commit 6804719

Please sign in to comment.