Sha256: fcb9d44ee9cbcd65beb8fe69cfaf8dedb99200803f73e4052db0d207cb40addc

Contents?: true

Size: 1.07 KB

Versions: 1

Compression:

Stored size: 1.07 KB

Contents

#  _____         _
# |_   _|__  ___| |_
#   | |/ _ \/ __| __|
#   | |  __/\__ \ |_
#   |_|\___||___/\__|
#
# for lib/facets/core/kernel/with_accessor.rb
#
# Extracted Tue Jun 06 09:30:19 EDT 2006
# Unit Tools Reap Test Extractor
#

require 'facets/core/kernel/with_accessor.rb'


  require 'test/unit'

  class TCKernel < Test::Unit::TestCase
    # fixture for #with_reader, #with_writer and #with_accessor
    class TestWith
      def initialize
        with_reader :foo => "FOO"
        with_writer :bar => "BAR"
        with_accessor :baz => "BAZ"
      end
      def get_bar
        @bar
      end
    end

    def test_with_reader
      assert_nothing_raised { @t = TestWith.new }
      assert_equal("FOO", @t.foo)
    end

    def test_with_writer
      assert_nothing_raised { @t = TestWith.new }
      assert_equal("BAR", @t.get_bar)
      @t.bar = "BAR2"
      assert_equal("BAR2", @t.get_bar)
    end

    def test_with_accessor
      assert_nothing_raised { @t = TestWith.new }
      assert_equal("BAZ", @t.baz)
      @t.baz = "BAZ2"
      assert_equal("BAZ2", @t.baz)
    end
  end


Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
facets-1.4.1 test/lib/facets/core/kernel/test_with_accessor.rb