Sha256: c082541e9776d41a12db18df669eef7b9feaf10bce3e6a6effff9d9c3c2c9aaa

Contents?: true

Size: 540 Bytes

Versions: 76

Compression:

Stored size: 540 Bytes

Contents

module MethodsSpecs
  class Issue < Object
    def unique_method_name
    end
  end

  # Trigger stub generation
  Issue.new.unique_method_name
end

describe "Kernel#methods" do
  it "lists methods available on an object" do
    Object.new.methods.include?("puts").should == true
  end

  it "lists only singleton methods if false is passed" do
    o = Object.new
    def o.foo; 123; end
    o.methods(false).should == ["foo"]
  end

  it "ignores stub methods" do
    Object.methods.include?(:unique_method_name).should be_false
  end
end

Version data entries

76 entries across 76 versions & 3 rubygems

Version Path
opal-0.10.1 spec/opal/core/kernel/methods_spec.rb
opal-0.10.0 spec/opal/core/kernel/methods_spec.rb
opal-0.10.0.rc2 spec/opal/core/kernel/methods_spec.rb
opal-0.9.4 spec/opal/core/kernel/methods_spec.rb
opal-0.9.3 spec/opal/core/kernel/methods_spec.rb
opal-0.10.0.rc1 spec/opal/core/kernel/methods_spec.rb
opal-0.10.0.beta5 spec/opal/core/kernel/methods_spec.rb
opal-0.10.0.beta4 spec/opal/core/kernel/methods_spec.rb
opal-0.10.0.beta3 spec/opal/core/kernel/methods_spec.rb
opal-0.10.0.beta2 spec/opal/core/kernel/methods_spec.rb
opal-0.10.0.beta1 spec/opal/core/kernel/methods_spec.rb
opal-0.9.2 spec/opal/core/kernel/methods_spec.rb
opal-0.9.0 spec/opal/core/kernel/methods_spec.rb
opal-0.9.0.rc1 spec/opal/core/kernel/methods_spec.rb
opal-0.9.0.beta2 spec/opal/core/kernel/methods_spec.rb
opal-0.9.0.beta1 spec/opal/core/kernel/methods_spec.rb
opal-0.8.1 spec/opal/core/kernel/methods_spec.rb
opal-0.8.1.rc1 spec/opal/core/kernel/methods_spec.rb
opal-wedge-0.9.0.dev spec/opal/core/kernel/methods_spec.rb
opal-0.8.0 spec/opal/core/kernel/methods_spec.rb