I want to pass YML-like config data to the scenario of cucumber.
for instance:
category:
subcategory:
name: whay
how to do this? thanks
I want to pass YML-like config data to the scenario of cucumber.
for instance:
category:
subcategory:
name: whay
how to do this? thanks
Following a test-driven approach, consider separating the YML parsing logic from your application logic, with something like:
def my_app_logic(my_hash)
# app logic goes here
end
def my_yml_parsing_logic
# load a file, or get a yml string
# parse it and return a hash
end
Then you would write unit tests to check the yml parsing logic and all its edge cases. You can also write unit tests for the app logic without having to worry about yml.
For your cucumber tests, consider mocking up (or using a factory to create) a good hash for testing, and use this hash in your step definition, so you can have a step like:
When I run my app logic on a hash with 5 categories
or something simple like that.