Sha256: 9c3751c1a07f86a2144a12b0d7488c561e8be907c578943d5c3eff573815032e

Contents?: true

Size: 804 Bytes

Versions: 7

Compression:

Stored size: 804 Bytes

Contents

require File.expand_path("../test_helper", __FILE__)

class ModuleTest < Test::Unit::TestCase

  context "A module" do
    setup do
      module A
      end
    end

    should "be able to be marked as unextendable" do
      assert A.respond_to?(:unextendable)
    end

    should "respond to :unextendable?" do
      assert A.respond_to?(:unextendable?)
    end

    context "which is not unextendable" do
      should "return false when asked to be unextendable" do
        assert !A.unextendable?
      end
    end

    context "which is unextendable" do
      setup do
        module U
          unextendable
          def name
            "U"
          end
        end
      end

      should "return true when asked to be unextendable" do
        assert U.unextendable?
      end
    end
  end

end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
unextendable-0.1.7 test/module_test.rb
unextendable-0.1.6 test/module_test.rb
unextendable-0.1.5 test/module_test.rb
unextendable-0.1.4 test/module_test.rb
unextendable-0.1.3 test/module_test.rb
unextendable-0.1.1 test/module_test.rb
unextendable-0.1.0 test/module_test.rb