[rspec-users] [Cucumber] Cucumber::Ast::Table values dynamic modfication

Antonov Alexei lists at ruby-forum.com
Thu Aug 18 10:33:34 EDT 2011


Hello there!

We have a web table that has values generated on action date:
If user logged in successfully today then we have on the web page:
|action | user  | date        | comment |
|log-in | user1 | 18/Aug/2011 | success |

And we have corresponding cucumber check step:

And action table is:
|action | user  | date        | comment |
|log-in | user1 | 18/Aug/2011 | success |

The question is: how can i modify corresponding cucumber table object at
step definition:

And /^action table is:$/ do |expected_action_table|
actual_action_table = get_action_table_from_ui
expected_action_table.diff!(actual_action_table)
end

to use something like

And action table is:
|action | user  | date  | comment |
|log-in | user1 | today | success |


Where today will be converted to date and put into cucumber table
object.
So the date weill matched every date check is run.

Thank you!

-- 
Posted via http://www.ruby-forum.com/.


More information about the rspec-users mailing list