Sha256: df668b595160eb374401d3e19beccea2e5a3e6e4ddd25abfa22bfd36e4e5c648
Contents?: true
Size: 911 Bytes
Versions: 16
Compression:
Stored size: 911 Bytes
Contents
require 'facets/kernel/attr_singleton.rb' require 'test/unit' class TestAttrSingleton < Test::Unit::TestCase class AttrSingletonMock def initialize attr_singleton_reader :foo #=> "FOO" attr_singleton_writer :bar #=> "BAR" attr_singleton_accessor :baz #=> "BAZ" @foo = "FOO" self.bar = "BAR" self.baz = "BAZ" end def get_bar @bar end end def test_attr_singleton_reader assert_nothing_raised { @t = AttrSingletonMock.new } assert_equal("FOO", @t.foo) end def test_attr_singleton_writer assert_nothing_raised { @t = AttrSingletonMock.new } assert_equal("BAR", @t.get_bar) @t.bar = "BAR2" assert_equal("BAR2", @t.get_bar) end def test_attr_singleton_accessor assert_nothing_raised { @t = AttrSingletonMock.new } assert_equal("BAZ", @t.baz) @t.baz = "BAZ2" assert_equal("BAZ2", @t.baz) end end
Version data entries
16 entries across 16 versions & 1 rubygems