You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using a gherkin step with a DataTable, if in my step definition I use table.symbolic_hashes and then later use table.hashes, then I am presented with the error undefined method 'tr' for :my_key:Symbol.
Expected Behavior
I should be able to access my table as a list of symbolic hashes as needed without changing any of the state of the DataTable. After this, I should be able to access my table as a list of string hashes without issue.
Current Behavior
With a feature file:
Feature: Testificate
Scenario: Testify
When test
| my_key |
| my_value |
And a step definition file:
When('test') do |table|
table.symbolic_hashes
table.hashes
end
I will receive the following error during execution:
Scenario: Testify
When test
| my_key |
| my_value |
undefined method `tr' for :my_key:Symbol
Did you mean? try (NoMethodError)
./features/step_definitions/testify_steps.rb:139:in `/^test$/'
./features/testben.feature:6:in `When test'
Do not set the @header_conversion_proc, but instead pass an optional block through the method build_hashes that will define the appropriate strategy for header conversion.
Context & Motivation
I ran into the issue when trying to minimize use of string hashes from the testing framework at my company.
Your Environment
Version used: 2.4.0
Operating System and version: macOS Sierra 10.12.6
Link to your project: N/A
The text was updated successfully, but these errors were encountered:
Thanks for reporting, @Ben-Behar! Is this something you'd be able to put together a pull request for? If so, we'd be happy to help you figure out the best implementation, etc.
Summary
When using a gherkin step with a DataTable, if in my step definition I use
table.symbolic_hashes
and then later usetable.hashes
, then I am presented with the errorundefined method 'tr' for :my_key:Symbol
.Expected Behavior
I should be able to access my table as a list of symbolic hashes as needed without changing any of the state of the DataTable. After this, I should be able to access my table as a list of string hashes without issue.
Current Behavior
With a feature file:
And a step definition file:
I will receive the following error during execution:
Possible Solution
In the following method:
Do not set the @header_conversion_proc, but instead pass an optional block through the method
build_hashes
that will define the appropriate strategy for header conversion.Context & Motivation
I ran into the issue when trying to minimize use of string hashes from the testing framework at my company.
Your Environment
The text was updated successfully, but these errors were encountered: