大佬教程收集整理的这篇文章主要介绍了ruby-on-rails – any_instance should_receive无法正常工作,大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。
@dns = "#{params[:domain].split('/').reverse.join('.')}.#{params[:zone]}" w = Whois::Client.new @r = w.query(@dns)
有路线:
@H_326_2@match "domains/:zone/*domain" => "domains#show"我正在使用Whois Gem
我想测试一下,所以我有一个测试:
it "should query 'google.com.ua' from /ua/com/google" do get :show,:zone => 'ua',:domain => 'com/google' dns = "google.com.ua" Whois::Client.any_instance.should_receive(:query).with(dns) end
结果我得到:
Exactly one instance should have received the following message(s) but didn't: query
哪里可以问题?我100%肯定.query被调用
以上是大佬教程为你收集整理的ruby-on-rails – any_instance should_receive无法正常工作全部内容,希望文章能够帮你解决ruby-on-rails – any_instance should_receive无法正常工作所遇到的程序开发问题。
如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。
本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。