How to create a subject helper method in Rspec2
- by Hedgehog
In rpsec 2.12 I expected this helper method definition to work:
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
The actual result is a failed spec:
expected #<Class:0x00000002ea5f90> to respond to :build
I expected the example to pass
Any suggestions on how to do this correctly?