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.3.36 spec/core/kernel/extend_spec.rb
opal-0.3.35 spec/core/kernel/extend_spec.rb
opal-0.3.34 spec/core/kernel/extend_spec.rb
opal-0.3.33 spec/core/kernel/extend_spec.rb
opal-0.3.32 spec/core/kernel/extend_spec.rb
opal-0.3.31 spec/core/kernel/extend_spec.rb
opal-0.3.30 spec/core/kernel/extend_spec.rb
opal-0.3.29 spec/core/kernel/extend_spec.rb
opal-0.3.28 spec/core/kernel/extend_spec.rb
opal-0.3.27 spec/core/kernel/extend_spec.rb