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-1.8.3.rc1 spec/opal/core/kernel/methods_spec.rb
opal-1.8.2 spec/opal/core/kernel/methods_spec.rb
opal-1.8.1 spec/opal/core/kernel/methods_spec.rb
opal-1.8.0 spec/opal/core/kernel/methods_spec.rb
opal-1.8.0.beta1 spec/opal/core/kernel/methods_spec.rb
opal-1.7.4 spec/opal/core/kernel/methods_spec.rb
opal-1.8.0.alpha1 spec/opal/core/kernel/methods_spec.rb
opal-1.7.3 spec/opal/core/kernel/methods_spec.rb
opal-1.7.2 spec/opal/core/kernel/methods_spec.rb
opal-1.7.1 spec/opal/core/kernel/methods_spec.rb
opal-1.7.0 spec/opal/core/kernel/methods_spec.rb
opal-1.7.0.rc1 spec/opal/core/kernel/methods_spec.rb
opal-1.6.1 spec/opal/core/kernel/methods_spec.rb
opal-1.6.0 spec/opal/core/kernel/methods_spec.rb
opal-1.6.0.rc1 spec/opal/core/kernel/methods_spec.rb
opal-1.6.0.alpha1 spec/opal/core/kernel/methods_spec.rb
opal-1.5.1 spec/opal/core/kernel/methods_spec.rb
opal-1.5.0 spec/opal/core/kernel/methods_spec.rb
opal-1.5.0.rc1 spec/opal/core/kernel/methods_spec.rb
opal-1.4.1 spec/opal/core/kernel/methods_spec.rb