send_test.rb

Chris Gaffney, 02/03/2013 05:41 PM

Download (280 Bytes)

 
1
require "test/unit"
2

    
3
class TestSend < ::Test::Unit::TestCase
4
  class Foo
5
    attr_accessor :bar
6
  end
7

    
8
  def test_send_to_write_returns_value
9
    f = Foo.new
10

    
11
    assert_nil f.bar
12
    assert_equal "test", f.bar = "test"
13
    assert_equal "test2", f.send("bar=", "test2")
14
  end
15
end