Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

2 more passing tests for the rubinius implementation

  • Loading branch information...
commit b150998ab12ea669c24f984d1ca69abda0be56b5 1 parent 44694d2
Dan Manges authored
Showing with 3 additions and 7 deletions.
  1. +2 −0  lib/mixology_rubinius.rb
  2. +1 −7 test/mixology_test.rb
2  lib/mixology_rubinius.rb
View
@@ -1,5 +1,6 @@
module Mixology
def mixin(mod)
+ unmix mod
reset_method_cache
IncludedModule.new(mod).attach_to metaclass
reset_method_cache
@@ -10,6 +11,7 @@ def unmix(mod_to_unmix)
last_super = metaclass
this_super = metaclass.direct_superclass
while this_super
+ break if this_super == self.class
if (this_super == mod_to_unmix ||
this_super.respond_to?(:module) && this_super.module == mod_to_unmix)
reset_method_cache
8 test/mixology_test.rb
View
@@ -44,9 +44,6 @@ def test_can_mixin_again
end
def test_unmix_effects_limited_to_instance
- if rubinius?
- print "PENDING"; return
- end
mixin = Module.new { def foo; "mixin"; end }
object = Class.new {include mixin}.new
assert_equal "mixin", object.foo
@@ -79,9 +76,6 @@ def test_included_modules_after_unmix
end
def test_included_modules_after_remix
- if rubinius?
- print "PENDING"; return
- end
mixin_one = Module.new
mixin_two = Module.new
object = Object.new
@@ -129,7 +123,7 @@ def test_nested_modules_are_mixedin_deeply
assert_equal [mixin, nested_module, nested_module_penultimate, nested_module_ultimate, Mixology, Kernel], (class << object; self; end).included_modules
end
- def test_nested_modules_are_mixedin_even_if_alrady_mixed_in
+ def test_nested_modules_are_mixedin_even_if_already_mixed_in
if rubinius?
print "PENDING"; return
end
Please sign in to comment.
Something went wrong with that request. Please try again.