Sha256: 824e9e0abdd1401ffb2a3645ce2d96d178b776c16526c6a7f3614b4326a114c0

Contents?: true

Size: 545 Bytes

Versions: 24

Compression:

Stored size: 545 Bytes

Contents

class RespondToSpecs
  def self.bar
    'done'
  end

  def undefed_method
    true
  end

  undef undefed_method
end

describe "Kernel.respond_to?" do
  it "indicates if a singleton object responds to a particular message" do
    RespondToSpecs.respond_to?(:bar).should == true
    RespondToSpecs.respond_to?(:baz).should == false
  end
end

describe "Kernel#respond_to?" do
  before :each do
    @a = RespondToSpecs.new
  end

  it "indicates if an object responds to a message" do
    @a.respond_to?(:undefed_method).should be_false
  end
end

Version data entries

24 entries across 24 versions & 1 rubygems

Version Path
opal-0.4.3 spec/opal/kernel/respond_to_spec.rb
opal-0.4.2 spec/opal/kernel/respond_to_spec.rb
opal-0.4.1 spec/opal/kernel/respond_to_spec.rb
opal-0.4.0 spec/opal/kernel/respond_to_spec.rb
opal-0.3.44 spec/rubyspec/core/kernel/respond_to_spec.rb
opal-0.3.43 spec/rubyspec/core/kernel/respond_to_spec.rb
opal-0.3.42 spec/core/kernel/respond_to_spec.rb
opal-0.3.41 spec/core/kernel/respond_to_spec.rb
opal-0.3.40 spec/core/kernel/respond_to_spec.rb
opal-0.3.39 spec/core/kernel/respond_to_spec.rb
opal-0.3.38 spec/core/kernel/respond_to_spec.rb
opal-0.3.37 spec/core/kernel/respond_to_spec.rb
opal-0.3.36 spec/core/kernel/respond_to_spec.rb
opal-0.3.35 spec/core/kernel/respond_to_spec.rb
opal-0.3.34 spec/core/kernel/respond_to_spec.rb
opal-0.3.33 spec/core/kernel/respond_to_spec.rb
opal-0.3.32 spec/core/kernel/respond_to_spec.rb
opal-0.3.31 spec/core/kernel/respond_to_spec.rb
opal-0.3.30 spec/core/kernel/respond_to_spec.rb
opal-0.3.29 spec/core/kernel/respond_to_spec.rb