Sha256: da6a1c90d25e57e3ecf99f43dff0aca6e83fe9d352bd95135dc03fd233615e49

Contents?: true

Size: 739 Bytes

Versions: 23

Compression:

Stored size: 739 Bytes

Contents

module RuntimeFixtures
  class A
  end

  class A::B
    module C
    end
  end

  module ModuleB
  end

  module ModuleA
    include ModuleB
  end
end

describe "Constants access via .$$ with dots (regression for #1418)" do
  it "allows to acces scopes on `Opal`" do
    `Opal.Object.$$.RuntimeFixtures.$$.A.$$.B.$$.C`.should == RuntimeFixtures::A::B::C
  end
end

describe "Inclusion of modules" do
  it "that have been included by other modules works" do
    # here ClassC would have failed to be created due to a bug in Opal.append_features
    module RuntimeFixtures
      class ClassC
        include ModuleA
        include ModuleB
      end
    end
    RuntimeFixtures::ClassC.new.class.should == RuntimeFixtures::ClassC
  end
end

Version data entries

23 entries across 23 versions & 1 rubygems

Version Path
opal-1.7.4 spec/opal/core/runtime/constants_spec.rb
opal-1.7.3 spec/opal/core/runtime/constants_spec.rb
opal-1.7.2 spec/opal/core/runtime/constants_spec.rb
opal-1.7.1 spec/opal/core/runtime/constants_spec.rb
opal-1.7.0 spec/opal/core/runtime/constants_spec.rb
opal-1.7.0.rc1 spec/opal/core/runtime/constants_spec.rb
opal-1.6.1 spec/opal/core/runtime/constants_spec.rb
opal-1.6.0 spec/opal/core/runtime/constants_spec.rb
opal-1.6.0.rc1 spec/opal/core/runtime/constants_spec.rb
opal-1.6.0.alpha1 spec/opal/core/runtime/constants_spec.rb
opal-1.5.1 spec/opal/core/runtime/constants_spec.rb
opal-1.5.0 spec/opal/core/runtime/constants_spec.rb
opal-1.5.0.rc1 spec/opal/core/runtime/constants_spec.rb
opal-1.4.1 spec/opal/core/runtime/constants_spec.rb
opal-1.4.0 spec/opal/core/runtime/constants_spec.rb
opal-1.4.0.alpha1 spec/opal/core/runtime/constants_spec.rb
opal-1.3.2 spec/opal/core/runtime/constants_spec.rb
opal-1.3.1 spec/opal/core/runtime/constants_spec.rb
opal-1.3.0 spec/opal/core/runtime/constants_spec.rb
opal-1.3.0.rc1 spec/opal/core/runtime/constants_spec.rb