Sha256: ff8d24cd7bab1038254d17f84198278b01c49f0386a62135bd5c5b0764c5e813

Contents?: true

Size: 295 Bytes

Versions: 23

Compression:

Stored size: 295 Bytes

Contents

class UndefSpecClass
  def meth(other);other;end
end

describe "The undef keyword" do
  it "undefines 'meth='" do
    obj = ::UndefSpecClass.new
    (obj.meth 5).should == 5
    class ::UndefSpecClass
      undef meth
    end
    lambda { obj.meth 5 }.should raise_error(NoMethodError)
  end
end

Version data entries

23 entries across 23 versions & 1 rubygems

Version Path
opal-0.3.41 spec/language/undef_spec.rb
opal-0.3.40 spec/language/undef_spec.rb
opal-0.3.39 spec/language/undef_spec.rb
opal-0.3.38 spec/language/undef_spec.rb
opal-0.3.37 spec/language/undef_spec.rb
opal-0.3.36 spec/language/undef_spec.rb
opal-0.3.35 spec/language/undef_spec.rb
opal-0.3.34 spec/language/undef_spec.rb
opal-0.3.33 spec/language/undef_spec.rb
opal-0.3.32 spec/language/undef_spec.rb
opal-0.3.31 spec/language/undef_spec.rb
opal-0.3.30 spec/language/undef_spec.rb
opal-0.3.29 spec/language/undef_spec.rb
opal-0.3.28 spec/language/undef_spec.rb
opal-0.3.27 spec/language/undef_spec.rb
opal-0.3.26 spec/language/undef_spec.rb
opal-0.3.25 spec/language/undef_spec.rb
opal-0.3.22 spec/language/undef_spec.rb
opal-0.3.21 test/language/undef_spec.rb
opal-0.3.20 test/language/undef_spec.rb