Sha256: 88581a6a68419b1108cd8b6d38ac695baf66d646396f323e29bcf2820d67a79d

Contents?: true

Size: 365 Bytes

Versions: 3

Compression:

Stored size: 365 Bytes

Contents

describe "Redefining a method" do
  
  it "replaces the original method" do
    def barFoo; 100; end
    barFoo.should == 100
    
    def barFoo; 200; end
    barFoo.should == 200
  end
end

describe "A singleton method definition" do
  it "can be declared for a local variable" do
    a = Object.new
    def a.foo
      5
    end
    a.foo.should == 5
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
opal-0.3.2 gems/core/spec/language/def_spec.rb
opal-0.3.1 gems/core/spec/language/def_spec.rb
opal-0.3.0 gems/core/spec/language/def_spec.rb