Skip to content
This repository
Browse code

Hax to workaround private send for Ruby 1.9. Consider moving to send!…

… and aliasing to send for < 1.9.

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7651 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
  • Loading branch information...
commit c81bd19b136995c8780bd4c6a136f950fcad0b61 1 parent e36b9b9
Jeremy Kemper jeremy authored
14 activesupport/test/core_ext/module/attribute_accessor_test.rb
@@ -2,32 +2,32 @@
2 2
3 3 class ModuleAttributeAccessorTest < Test::Unit::TestCase
4 4 def setup
5   - @module = Module.new do
  5 + m = @module = Module.new do
6 6 mattr_accessor :foo
7 7 mattr_accessor :bar, :instance_writer => false
8 8 end
9 9 @class = Class.new
10   - @class.send :include, @module
  10 + @class.instance_eval { include m }
11 11 @object = @class.new
12 12 end
13   -
  13 +
14 14 def test_should_use_mattr_default
15 15 assert_nil @module.foo
16 16 assert_nil @object.foo
17 17 end
18   -
  18 +
19 19 def test_should_set_mattr_value
20 20 @module.foo = :test
21 21 assert_equal :test, @object.foo
22   -
  22 +
23 23 @object.foo = :test2
24 24 assert_equal :test2, @module.foo
25 25 end
26   -
  26 +
27 27 def test_should_not_create_instance_writer
28 28 assert @module.respond_to?(:foo)
29 29 assert @module.respond_to?(:foo=)
30 30 assert @object.respond_to?(:bar)
31 31 assert !@object.respond_to?(:bar=)
32 32 end
33   -end
  33 +end

0 comments on commit c81bd19

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