Skip to content

Commit

Permalink
Revert "Updated with Rubinius Support"
Browse files Browse the repository at this point in the history
This reverts commit 3ce23a8.
  • Loading branch information
Marc Peabody committed Jan 12, 2011
1 parent b7c27f5 commit 6701017
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 25 deletions.
2 changes: 1 addition & 1 deletion Rakefile
Expand Up @@ -75,7 +75,7 @@ module RubyImpls

# List of expected ruby implementations.
def self.expected
%w(ruby-1.8.6 ruby-1.8.7 ruby-1.9.2 jruby ree rbx)
%w(ruby-1.8.6 ruby-1.8.7 ruby-1.9.2 jruby ree)
end
end

Expand Down
2 changes: 1 addition & 1 deletion src/about_methods.rb
Expand Up @@ -44,7 +44,7 @@ def test_calling_global_methods_with_wrong_number_of_arguments
my_global_method
end
#--
pattern = "wrong (number|#) of arguments|given \\d+, expected \\d+"
pattern = "wrong (number|#) of arguments"
#++
assert_match(/#{__(pattern)}/, exception.message)

Expand Down
30 changes: 14 additions & 16 deletions src/about_objects.rb
Expand Up @@ -30,22 +30,20 @@ def test_every_object_has_different_id
assert_equal __(true), obj.object_id != another_obj.object_id
end

not_in_ruby_version('rbx') do
def test_some_system_objects_always_have_the_same_id
assert_equal __(0), false.object_id
assert_equal __(2), true.object_id
assert_equal __(4), nil.object_id
end

def test_small_integers_have_fixed_ids
assert_equal __(1), 0.object_id
assert_equal __(3), 1.object_id
assert_equal __(5), 2.object_id
assert_equal __(201), 100.object_id

# THINK ABOUT IT:
# What pattern do the object IDs for small integers follow?
end
def test_some_system_objects_always_have_the_same_id
assert_equal __(0), false.object_id
assert_equal __(2), true.object_id
assert_equal __(4), nil.object_id
end

def test_small_integers_have_fixed_ids
assert_equal __(1), 0.object_id
assert_equal __(3), 1.object_id
assert_equal __(5), 2.object_id
assert_equal __(201), 100.object_id

# THINK ABOUT IT:
# What pattern do the object IDs for small integers follow?
end

def test_clone_creates_a_different_object
Expand Down
9 changes: 2 additions & 7 deletions src/edgecase.rb
Expand Up @@ -13,18 +13,13 @@ class FillMeInError < StandardError
def ruby_version?(version)
RUBY_VERSION =~ /^#{version}/ ||
(version == 'jruby' && defined?(JRUBY_VERSION)) ||
(version == 'mri' && (! defined?(JRUBY_VERSION) && ! defined?(Rubinius))) ||
(version == 'rbx' && defined?(Rubinius))
(version == 'mri' && ! defined?(JRUBY_VERSION))
end

def in_ruby_version(*versions)
yield if versions.any? { |v| ruby_version?(v) }
end

def not_in_ruby_version(*versions)
yield unless versions.any? { |v| ruby_version?(v) }
end

# Standard, generic replacement value.
# If value19 is given, it is used inplace of value for Ruby 1.9.
def __(value="FILL ME IN", value19=:mu)
Expand Down Expand Up @@ -57,7 +52,7 @@ def ____(method=nil)
end
end

in_ruby_version("1.9", "rbx") do
in_ruby_version("1.9") do
public :method_missing
end
end
Expand Down

0 comments on commit 6701017

Please sign in to comment.