Skip to content

Array with hashes fails if default is set #596

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed

Conversation

ramarnat
Copy link

Two tests added, one fails (the one with defaults) the other one without defaults does not fail.

@ramarnat
Copy link
Author

Found a strange issue (drove me crazy today!)

for an array of hashes

[{"order_number"=>1, "product"=>"widget", "customer"=>"John", "quantity"=>1},
 {"order_number"=>2, "product"=>"widget", "customer"=>"Mary"}]

Test 1 incorrectly returns, if a default is set:

[["order_number", 2],
 ["product", "widget"],
 ["customer", "Mary"],
 ["quantity", 1]]

where as Test 2 correctly returns, if the default is not set

[{"order_number"=>1, "product"=>"widget", "customer"=>"John", "quantity"=>1},
 {"order_number"=>2, "product"=>"widget", "customer"=>"Mary"}]

@ramarnat
Copy link
Author

@dblock

The Travis build has correctly failed on the test I created. Please take a look and let me know if you need anything else.

@dblock
Copy link
Member

dblock commented Mar 14, 2014

Thanks @ramarnat. What I need now is a fix for this problem :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants