Sha256: d66eaae793b7dc2c9c774fa4c0e7f1acadeb4ca198ec66eaa99530dafdfcd93e

Contents?: true

Size: 1.06 KB

Versions: 1

Compression:

Stored size: 1.06 KB

Contents

#  _____         _
# |_   _|__  ___| |_
#   | |/ _ \/ __| __|
#   | |  __/\__ \ |_
#   |_|\___||___/\__|
#
# for lib/facet/kernel/with_accessor.rb
#
# Extracted Wed Jan 25 11:25:39 EST 2006
# Unit Tools Reap Test Extractor
#

require 'facet/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.0.3 packages/core/test/lib/facet/kernel/test_with_accessor.rb