diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2016-10-15 22:59:39 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2016-10-15 22:59:39 +0000 |
commit | caa46f0d0b2f595c9b5e882694a78d6980ebe60c (patch) | |
tree | 9ae0a2eeba64a659b350a3f780d7a42e129adf6f | |
parent | 2ed1688d4e2882869c9c6b4f753da8840277dda7 (diff) | |
download | ruby-caa46f0d0b2f595c9b5e882694a78d6980ebe60c.tar.gz |
test_refinement.rb: test_symbol_proc
* test/ruby/test_refinement.rb (test_symbol_proc): move from
test_symbol.rb [Feature #9451]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56431 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r-- | test/ruby/test_refinement.rb | 8 | ||||
-rw-r--r-- | test/ruby/test_symbol.rb | 12 |
2 files changed, 8 insertions, 12 deletions
diff --git a/test/ruby/test_refinement.rb b/test/ruby/test_refinement.rb index a53fe2b522..2ecbf8edf0 100644 --- a/test/ruby/test_refinement.rb +++ b/test/ruby/test_refinement.rb @@ -74,6 +74,10 @@ class TestRefinement < Test::Unit::TestCase using TestRefinement::FooExt begin + def self.map_x_on(foo) + [foo].map(&:x)[0] + end + def self.invoke_x_on(foo) return foo.x end @@ -1737,6 +1741,10 @@ class TestRefinement < Test::Unit::TestCase INPUT end + def test_symbol_proc + assert_equal("FooExt#x", FooExtClient.map_x_on(Foo.new)) + end + private def eval_using(mod, s) diff --git a/test/ruby/test_symbol.rb b/test/ruby/test_symbol.rb index a135338edb..d8c91c1eea 100644 --- a/test/ruby/test_symbol.rb +++ b/test/ruby/test_symbol.rb @@ -435,16 +435,4 @@ class TestSymbol < Test::Unit::TestCase assert_equal str, str.to_sym.to_s assert_not_predicate(str, :frozen?, bug11721) end - - module WithRefinements - using Module.new {refine(Integer) {alias inc succ}} - def mapinc(a) - a.map(&:inc) - end - end - - def test_proc_with_refinements - obj = Object.new.extend WithRefinements - assert_equal [*1..3], obj.mapinc(0..2) - end end |