egonSchiele / contracts.ruby

Contracts for Ruby.
http://egonschiele.github.com/contracts.ruby
BSD 2-Clause "Simplified" License
1.44k stars 82 forks source link

Method validate_decorators! raises NameError #279

Closed BurdetteLamar closed 6 years ago

BurdetteLamar commented 6 years ago

require 'contracts' include Contracts Contract String => String Contract Num => String def foo x end

This code raises a NameError:

$ ruby foo_test.rb c:/Ruby22/lib/ruby/gems/2.2.0/gems/contracts-0.16.0/lib/contracts/method_handler .rb:160:in validate_decorators!': undefined local variable or methodname' for

(NameError)

    from c:/Ruby22/lib/ruby/gems/2.2.0/gems/contracts-0.16.0/lib/contracts/m

ethod_handler.rb:31:in handle' from c:/Ruby22/lib/ruby/gems/2.2.0/gems/contracts-0.16.0/lib/contracts/d ecorators.rb:13:inmethod_added' from foo_test.rb:7:in `

'

It should instead raise a RuntimeError with the intended message.

BurdetteLamar commented 6 years ago

Sorry, this is fixed here (since October). The error is seen in the gem. Closing.