Sha256: c7464b31d7c065d234c2027ddbf65c5ff2ef50f28e971a4c0c580a284bdbc6c9

Contents?: true

Size: 1.05 KB

Versions: 36

Compression:

Stored size: 1.05 KB

Contents

require 'test_helper'
require 'tins'

module Tins
  class AnnotateTest < Test::Unit::TestCase
    require 'tins/xt/annotate'

    class A
      annotate :foo

      annotate :bar

      foo 'test foo1'
      bar 'test bar1'
      def first
      end

      foo 'test foo2'
      bar 'test bar2'
      def second
      end

      bar 'test bar3'
      def third
      end
    end

    def test_annotations_via_class
      assert_equal 'test foo1', A.foo_of(:first)
      assert_equal 'test bar1', A.bar_of(:first)
      assert_equal 'test foo2', A.foo_of(:second)
      assert_equal 'test bar2', A.bar_of(:second)
      assert_equal nil, A.foo_of(:third)
      assert_equal 'test bar3', A.bar_of(:third)
    end

    def test_annotations_via_instance
      a = A.new
      assert_equal 'test foo1', a.foo_of(:first)
      assert_equal 'test bar1', a.bar_of(:first)
      assert_equal 'test foo2', a.foo_of(:second)
      assert_equal 'test bar2', a.bar_of(:second)
      assert_equal nil, a.foo_of(:third)
      assert_equal 'test bar3', a.bar_of(:third)
    end
  end
end

Version data entries

36 entries across 34 versions & 4 rubygems

Version Path
tdiary-5.0.11 vendor/bundle/gems/tins-1.16.3/tests/annotate_test.rb
tins-1.18.0 tests/annotate_test.rb
tins-1.17.0 tests/annotate_test.rb
tdiary-5.0.9 vendor/bundle/gems/tins-1.16.3/tests/annotate_test.rb
tdiary-5.0.8 vendor/bundle/gems/tdiary-5.0.7/vendor/bundle/gems/tins-1.16.3/tests/annotate_test.rb
tdiary-5.0.7 vendor/bundle/gems/tins-1.16.3/tests/annotate_test.rb
tins-1.16.3 tests/annotate_test.rb
tins-1.16.2 tests/annotate_test.rb
tins-1.16.1 tests/annotate_test.rb
tins-1.16.0 tests/annotate_test.rb
tins-1.15.1 tests/annotate_test.rb
tdiary-5.0.6 vendor/bundle/gems/tins-1.15.0/tests/annotate_test.rb
tins-1.15.0 tests/annotate_test.rb
tdiary-5.0.5 vendor/bundle/gems/tins-1.13.2/tests/annotate_test.rb
tdiary-5.0.5 vendor/bundle/gems/tdiary-5.0.4/vendor/bundle/gems/tins-1.13.2/tests/annotate_test.rb
tdiary-5.0.5 vendor/bundle/gems/tins-1.14.0/tests/annotate_test.rb
tins-1.14.0 tests/annotate_test.rb
tins-1.13.3 tests/annotate_test.rb
enju_leaf-1.2.1 vendor/bundle/ruby/2.3/gems/tins-1.13.2/tests/annotate_test.rb
tdiary-5.0.4 vendor/bundle/gems/tins-1.13.2/tests/annotate_test.rb