Sha256: 7d2cd0b738dc8f991ed39f1bcca6333e2320293e825764bc4d811e938a53be23

Contents?: true

Size: 1.56 KB

Versions: 1

Compression:

Stored size: 1.56 KB

Contents

#  _____         _
# |_   _|__  ___| |_
#   | |/ _ \/ __| __|
#   | |  __/\__ \ |_
#   |_|\___||___/\__|
#
# for lib/facets/more/opencascade.rb
#
# Extracted Wed Aug 23 18:22:52 EDT 2006
# Unit Tools Reap Test Extractor
#

require 'facets/more/opencascade.rb'


  require 'test/unit'

  class TestOpenCascade1 < Test::Unit::TestCase

    def test_1_01
      o = OpenCascade[:a=>1,:b=>2]
      assert_equal( 1, o.a )
      assert_equal( 2, o.b )
    end

    def test_1_02
      o = OpenCascade[:a=>1,:b=>2,:c=>{:x=>9}]
      assert_equal( 9, o.c.x )
    end

    def test_1_03
      f0 = OpenCascade.new
      f0[:a] = 1
      assert_equal( [[:a,1]], f0.to_a )
      assert_equal( {:a=>1}, f0.to_h )
    end

    def test_1_04
      f0 = OpenCascade[:a=>1]
      f0[:b] = 2
      assert_equal( {:a=>1,:b=>2}, f0.to_h )
    end
  end

  class TestOpenCascade2 < Test::Unit::TestCase

    def test_02_001
      f0 = OpenCascade[:f0=>"f0"]
      h0 = { :h0=>"h0" }
      assert_equal( OpenCascade[:f0=>"f0", :h0=>"h0"], f0.send(:merge,h0) )
      assert_equal( {:f0=>"f0", :h0=>"h0"}, h0.merge( f0 ) )
    end

    def test_02_002
      f1 = OpenCascade[:f1=>"f1"]
      h1 = { :h1=>"h1" }
      f1.send(:update, h1)
      h1.update( f1 )
      assert_equal( OpenCascade[:f1=>"f1", :h1=>"h1"], f1 )
      assert_equal( {:f1=>"f1", :h1=>"h1"}, h1 )
    end
  end

  class TestOpenCascade3 < Test::Unit::TestCase

    def test_01_001
      fo = OpenCascade.new
      99.times{ |i| fo.__send__( "n#{i}=", 1 ) }
      99.times{ |i|
        assert_equal( 1, fo.__send__( "n#{i}" ) )
      }
    end
  end


Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
facets-1.7.30 test/lib/facets/more/test_opencascade.rb