在 rpsec 2.12 中,我希望这个辅助方法定义能够工作:
module X
private
def build_them(type)
puts 'Catching the star'
end
end
context 'public/private instance methods' do
subject{ Class.new { extend(::X) } }
def subject.build(type)
puts "Throwing a star"
build_them(type)
end
it{ should respond_to :build}
end
实际结果是失败的规范:
expected #<Class:0x00000002ea5f90> to respond to :build
我希望这个例子能够通过
有关如何正确执行此操作的任何建议?