Sha256: 82c0754cac08ed358c44ec1bb88c9d479e128d499b7752980943f98cad0e61ee

Contents?: true

Size: 377 Bytes

Versions: 50

Compression:

Stored size: 377 Bytes

Contents

module KernelExtendSpecs
  module Mod
    def foo; 3.142; end
  end

  class A
    extend Mod
  end
end

describe "Kernel#extend" do
  it "extends the class/module with the module" do
    KernelExtendSpecs::A.foo.should == 3.142
  end

  it "extends the object with the module" do
    obj = Object.new
    obj.extend KernelExtendSpecs::Mod
    obj.foo.should == 3.142
  end
end

Version data entries

50 entries across 50 versions & 3 rubygems

Version Path
opal-0.9.0.beta2 spec/opal/core/kernel/extend_spec.rb
opal-0.9.0.beta1 spec/opal/core/kernel/extend_spec.rb
opal-0.8.1 spec/opal/core/kernel/extend_spec.rb
opal-0.8.1.rc1 spec/opal/core/kernel/extend_spec.rb
opal-wedge-0.9.0.dev spec/opal/core/kernel/extend_spec.rb
opal-0.8.0 spec/opal/core/kernel/extend_spec.rb
opal-0.8.0.rc3 spec/opal/core/kernel/extend_spec.rb
opal-0.8.0.rc2 spec/opal/core/kernel/extend_spec.rb
opal-0.8.0.rc1 spec/opal/core/kernel/extend_spec.rb
opal-0.8.0.beta1 spec/opal/core/kernel/extend_spec.rb
opal-0.7.2 spec/opal/core/kernel/extend_spec.rb
opal-0.7.1 spec/opal/core/kernel/extend_spec.rb
opal-0.7.0 spec/opal/core/kernel/extend_spec.rb
opal-0.7.0.rc1 spec/opal/core/kernel/extend_spec.rb
opal-0.7.0.beta3 spec/opal/core/kernel/extend_spec.rb
opal-0.6.3 spec/opal/core/kernel/extend_spec.rb
opal-0.7.0.beta2 spec/opal/core/kernel/extend_spec.rb
opal-cj-0.7.0.beta2 spec/opal/core/kernel/extend_spec.rb
opal-cj-0.7.0.beta1 spec/opal/core/kernel/extend_spec.rb
opal-0.7.0.beta1 spec/opal/core/kernel/extend_spec.rb