我正在使用 Cucumber、Ruby 和 SitePrism 类。我试图在 SitePrism 类中进行断言,并且在包含 RSpec::Matchers 时设法使用了“期望”方法,但是,我使用“binding.pry”进行调试,我刚刚注意到我不是能够再使用它,因为它不断失败并出现以下错误:
NoMethodError:为#RSpec::Matchers::BuiltIn::Output:0x0000000a5536b0 调用私有方法`print'> 你的意思是?printf sprintf
你知道错误可能是什么吗?我尝试了不同的方法来包含 RSpec::Matchers,所以不确定我是否做错了什么?
*Method 1:*
include RSpec::Matchers
class SitePrismPage
*Method 2:*
class SitePrismPage
extend RSpec::Matchers
*Method 3:*
class SitePrismPage
end
World{SitePrismPage.new}