Sha256: 766f6831645a29dddb534e044b4539f0359fe5f5438a941186ac4cd7152d0845

Contents?: true

Size: 783 Bytes

Versions: 14

Compression:

Stored size: 783 Bytes

Contents

describe "module" do
  describe "anonymous?" do
    it "should return true for an anonymous module" do
      Module.new.anonymous?.should == true
    end
    
    it "should return true for an anonymous class" do
      Class.new.anonymous?.should == true
    end
    
    it "should return false for a named module" do
      Kernel.anonymous?.should == false
    end
    
    it "should return false for a named class" do
      Object.anonymous?.should == false
    end
    
    it "should return false for module that acquired a name" do
      NamedModule = Module.new
      NamedModule.anonymous?.should == false
    end
    
    it "should return false for module that acquired a name" do
      NamedClass = Class.new
      NamedClass.anonymous?.should == false
    end
  end
end

Version data entries

14 entries across 14 versions & 2 rubygems

Version Path
motion-support-1.2.1 spec/motion-support/core_ext/module/anonymous_spec.rb
motion-support-1.1.1 spec/motion-support/core_ext/module/anonymous_spec.rb
motion-support-1.2.0 spec/motion-support/core_ext/module/anonymous_spec.rb
motion-support-1.1.0 spec/motion-support/core_ext/module/anonymous_spec.rb
motion-support-1.0.0 spec/motion-support/core_ext/module/anonymous_spec.rb
motion-support-0.3.0 spec/motion-support/core_ext/module/anonymous_spec.rb
motion_blender-support-0.2.8 spec/motion-support/core_ext/module/anonymous_spec.rb
motion_blender-support-0.2.7 spec/motion-support/core_ext/module/anonymous_spec.rb
motion-support-0.2.6 spec/motion-support/core_ext/module/anonymous_spec.rb
motion-support-0.2.5 spec/motion-support/core_ext/module/anonymous_spec.rb
motion-support-0.2.4 spec/motion-support/core_ext/module/anonymous_spec.rb
motion-support-0.2.3 spec/motion-support/core_ext/module/anonymous_spec.rb
motion-support-0.2.2 spec/motion-support/core_ext/module/anonymous_spec.rb
motion-support-0.2.0 spec/motion-support/core_ext/module/anonymous_spec.rb