I am using clamp - the command line framework for my ruby application, and am unsure of how to initiate my clamp objects for unit testing. My clamp object looks like this
class myCommand < Clamp::Command
parameter "first", "first param"
parameter "second", "second param"
def execute
#Data
end
end
And is run via command line like so
$~> myCommand first second
At the moment, in my rspec tests im having to set the objects properties directly like so.
before(:each) do
$stdout = StringIO.new
@my_command = myCommand.new("")
@my_command.first= "first"
@my_command.second= "second"
end
This doesnt seem to be the proper way to initiate the clamp objects for testing, but am unsure of the correct way to do this. Wondered if anyone had any ideas. Thanks