On 4 Aug 2010, at 1:05 AM, David Chelimsky wrote:
>
One other thought I've had is keyword syntax. While currently I'm writing:
it_satisfies_contract "[Entity] Collection:", :children, :child, Child.name
I prefer keyword arguments, so I'd like to write:
it_satisfies_contract "[Entity] Collection:",
:children,
item_name: "child",
class_name: Child.name
Currently that would mean rewriting the contract like this:
contract "[Entity] Collection:" do |collection_name, options|
# ...
describe "#{collection_name}" do
describe "Helper methods:" do
describe "#new_#{options[:item_name]}, #get_#{options[:item_name]}" do
# ...
WDYT about RSpec automatically translating keyword options to methods? They'd
need to be defined as singleton class methods and instance methods to have the
same availability as block parameters.
Ash
--
http://www.patchspace.co.uk/
http://www.linkedin.com/in/ashleymoran
_______________________________________________
rspec-users mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/rspec-users