Wpadam tu w coś dziwnego. Mam "authentator", który polega na ND5 do mieszania pewnego łańcucha pasuje jako hasło. Problem podczas uruchamiania moich testów jest taka:Digest :: MD5 w Rubim 1.9.3
NoMethodError: undefined method `md5' for #<CASServer::Authenticators::Billing:0x007fd8e6c906a0>
./models/authenticators/billing.rb:63:in `validate'
./routes/login.rb:166:in `block (2 levels) in <class:Server>'
./routes/login.rb:158:in `each'
./routes/login.rb:158:in `block in <class:Server>'
(eval):2:in `click_button'
./features/step_definitions/when_steps.rb:32:in `/^I enter "(.*)" as username and the generated username password and log in$/'
./features/rubycas.login.feature:14:in `When I enter "username" as username and the generated username password and log in'
Więc w zasadzie on nie rozpoznaje MD5 jako część biblioteki Digest. Ten problem występuje, gdy uruchomione testy w IDE, a także w konsoli IRB:
1.9.3-p125 :001 > require "digest/md5" and Digest::MD5("test")
NoMethodError: undefined method `MD5' for Digest:Module
Jednak, kiedy należy wykonać:
[[email protected] /home/morn/rubycas/current]# ruby
require "digest/md5" and Digest::MD5("test")
otrzymuję żadnych błędów, wysypisk lub wyjątki . Ruby po prostu to akceptuje. Czego mi brakuje, aby działać z MD5?
dzięki pracował ...... jestem takim idiotą, że nie widząc to: S –
mógłbyś podać link do dokumentacji metody, proszę? – Kostas
Digest :: MD5.hexdigest jest również całkiem niezły – reconbot