Sha256: 715bd3909ffe9e461c220daad267a4082598881ee9fd0d04a5ba49e8ec8efb30
Contents?: true
Size: 800 Bytes
Versions: 1
Compression:
Stored size: 800 Bytes
Contents
require 'test/unit' require 'carat/dynamic-mixin' # fixture module Mixin extend DynamicMixin def self.default_options { :name => "D" } end def hello "#{dynamic_options[:name]}" end end module Mixin2 extend DynamicMixin include Mixin[ :name => "Q" ] end class T include Mixin[ :name => "T" ] end class S include Mixin[ :name => "S" ] end class R include Mixin2[ :name => "R" ] end class Q include Mixin2 end # test class TC_DynamicMixin < Test::Unit::TestCase def setup @t = T.new @s = S.new @r = R.new @q = Q.new end def test_T assert_equal( 'T', @t.hello ) end def test_S assert_equal( 'S', @s.hello ) end def test_R assert_equal( 'R', @r.hello ) end def test_Q assert_equal( 'Q', @q.hello ) end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
carats-0.3.0 | test/tc_dynamic-mixin.rb |