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.6.2 spec/opal/core/kernel/extend_spec.rb
opal-0.6.1 spec/opal/core/kernel/extend_spec.rb
opal-0.6.0 spec/opal/core/kernel/extend_spec.rb
opal-0.5.5 spec/opal/core/kernel/extend_spec.rb
opal-0.5.4 spec/corelib/kernel/extend_spec.rb
opal-0.5.2 spec/corelib/kernel/extend_spec.rb
opal-0.5.0 spec/corelib/kernel/extend_spec.rb
opal-0.4.4 spec/opal/kernel/extend_spec.rb
opal-0.4.3 spec/opal/kernel/extend_spec.rb
opal-0.4.2 spec/opal/kernel/extend_spec.rb
opal-0.4.1 spec/opal/kernel/extend_spec.rb
opal-0.4.0 spec/opal/kernel/extend_spec.rb
opal-0.3.44 spec/rubyspec/core/kernel/extend_spec.rb
opal-0.3.43 spec/rubyspec/core/kernel/extend_spec.rb
opal-0.3.42 spec/core/kernel/extend_spec.rb
opal-0.3.41 spec/core/kernel/extend_spec.rb
opal-0.3.40 spec/core/kernel/extend_spec.rb
opal-0.3.39 spec/core/kernel/extend_spec.rb
opal-0.3.38 spec/core/kernel/extend_spec.rb
opal-0.3.37 spec/core/kernel/extend_spec.rb