Sha256: 3bcf9223b989b3384268f9a35d090f090ea679d1d68b785d6585ed620ea31bd6

Contents?: true

Size: 1.07 KB

Versions: 1

Compression:

Stored size: 1.07 KB

Contents

#  _____         _
# |_   _|__  ___| |_
#   | |/ _ \/ __| __|
#   | |  __/\__ \ |_
#   |_|\___||___/\__|
#
# for lib/facets/core/kernel/with_accessor.rb
#
# Extracted Fri Sep 08 20:20:32 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.7.46 test/lib/facets/core/kernel/test_with_accessor.rb