Sha256: abee6197576231dff436afa40745ded533c05cbd418766bdd176a71a296510dc

Contents?: true

Size: 599 Bytes

Versions: 14

Compression:

Stored size: 599 Bytes

Contents

require 'test_helper'
require 'tins/concern'

module Tins
  class ConcernTest < Test::Unit::TestCase
    module ConcernTroll
      extend ::Tins::Concern

      included do
        @included = :included
      end

      module ClassMethods
        def class_foo
          :class_foo
        end
      end

      def foo
        :foo
      end
    end

    class Troll
      include ConcernTroll
    end

    def test_concern
      assert_equal :class_foo, Troll.class_foo
      assert_equal :foo, Troll.new.foo
      assert_equal :included, Troll.instance_variable_get(:@included)
    end
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
tins-0.11.0 tests/concern_test.rb
tins-0.10.0 tests/concern_test.rb
tins-0.9.0 tests/concern_test.rb
tins-0.8.4 tests/concern_test.rb
tins-0.8.3 tests/concern_test.rb
tins-0.8.2 tests/concern_test.rb
tins-0.8.0 tests/concern_test.rb
tins-0.7.4 tests/concern_test.rb
tins-0.7.3 tests/concern_test.rb
tins-0.7.2 tests/concern_test.rb
tins-0.7.1 tests/concern_test.rb
tins-0.7.0 tests/concern_test.rb
tins-0.6.0 tests/concern_test.rb
tins-0.5.6 tests/concern_test.rb