Sha256: 587159a1f5ecc2ad054826cda33a20c44d87842b1a707e95514e73675e842d4a

Contents?: true

Size: 411 Bytes

Versions: 16

Compression:

Stored size: 411 Bytes

Contents

describe "A singleton class" do
  it "is NilClass for nil" do
    nil.singleton_class.should == NilClass
  end

  it "is a singleton Class instance" do
    o = mock('x')
    o.singleton_class.should be_kind_of(Class)
    o.singleton_class.should_not equal(Object)
  end

  it "is a Class for classes" do
    ClassSpecs::A::singleton_class.should be_kind_of(Class)
  end
end

module ClassSpecs
  class A; end
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
opal-0.3.38 spec/language/singleton_class_spec.rb
opal-0.3.37 spec/language/singleton_class_spec.rb
opal-0.3.36 spec/language/singleton_class_spec.rb
opal-0.3.35 spec/language/singleton_class_spec.rb
opal-0.3.34 spec/language/singleton_class_spec.rb
opal-0.3.33 spec/language/singleton_class_spec.rb
opal-0.3.32 spec/language/singleton_class_spec.rb
opal-0.3.31 spec/language/singleton_class_spec.rb
opal-0.3.30 spec/language/singleton_class_spec.rb
opal-0.3.29 spec/language/singleton_class_spec.rb
opal-0.3.28 spec/language/singleton_class_spec.rb
opal-0.3.27 spec/language/singleton_class_spec.rb
opal-0.3.26 spec/language/singleton_class_spec.rb
opal-0.3.25 spec/language/singleton_class_spec.rb
opal-0.3.22 spec/language/singleton_class_spec.rb
opal-0.3.21 test/language/singleton_class_spec.rb