Skip to content
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

OneviewCookbook::Helper#get_diff with two no-diff hashes returns '\n' #98

Closed
tmiotto opened this issue Jan 9, 2017 · 1 comment
Closed

Comments

@tmiotto
Copy link
Contributor

tmiotto commented Jan 9, 2017

Scenario/Intent

When trying to compare two hashes that has no-diff ( i.e. for each key 'k' in 'a', a[k] == b[k] ) with the OneviewCookbook::Helper#get_diff the result returned is '\n'.

Environment Details

  • oneview Cookbook Version: 1.1.0
  • OneView Version: N/A
  • chef-client Version: N/A
  • platform: N/A

Steps to Reproduce

Use get_diff method with two hashes with no-diff like:

a = { a: 'test', b: 'second' }
b = { a: 'test', c: 'other', b: 'second' }
get_diff(a, b)

Expected Result

get_diff should return ''

Actual Result

get_diff returns '\n'

@jsmartt
Copy link
Contributor

jsmartt commented Jan 12, 2017

It uses "\n" as the initial string here, and I think I did that so that I could just tack the diff onto the end of the log statement (like this), and not have to repeat myself. We can always just set the default string to an empty string and add a newline before the diff though (or set it to an empty string if recursive_diff returns just \n). That's fine with me :)

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

No branches or pull requests

2 participants