Skip to content

Refactor redisget() method #211

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

Merged
merged 1 commit into from
Jul 1, 2017
Merged

Conversation

petems
Copy link
Member

@petems petems commented Jun 22, 2017

@petems
Copy link
Member Author

petems commented Jun 22, 2017

@ghoneycutt can you check this change doesn't break your redisget() behaviour?

context 'should error if connection to redis server cannot be made and no default is specified' do
it { is_expected.to run.with_params('nonexistent_key', BROKEN_URL).and_raise_error(Puppet::Error, /connection to redis server failed - getaddrinfo/) }
context 'should error if connection to remote redis server cannot be made and no default is specified' do
it { is_expected.to run.with_params('nonexistent_key', REMOTE_BROKEN_URL).and_raise_error(Puppet::Error, 'connection to redis server failed - getaddrinfo: nodename nor servname provided, or not known') }
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

change to regex to appease different versions of puppet/ruby

/connection to redis server failed/

@ghoneycutt
Copy link
Member

I'll give this a go today.

@ghoneycutt
Copy link
Member

Tested the functionality and works as expected.

@petems petems force-pushed the use_redisget_refactor branch from d098506 to 42c9788 Compare June 26, 2017 21:29
* The original behaviour seemed a little brittle to me, so I asked for some help
* This new refactor seems a lot cleaner, and deals with the handling of getting a nil response a lot cleaner
* Specs edited to add in two types of disconnection errors: getaddrinfo for non-existent DNS and ECONNREFUSED for when connection refused
* Credit: https://codereview.stackexchange.com/questions/163727/redis-lookup-with-a-default-value/
@petems petems force-pushed the use_redisget_refactor branch from 42c9788 to 3d625e4 Compare June 30, 2017 20:02
@petems petems merged commit 620302f into voxpupuli:master Jul 1, 2017
@petems petems deleted the use_redisget_refactor branch July 1, 2017 11:38
cegeka-jenkins pushed a commit to cegeka/puppet-redis that referenced this pull request Feb 16, 2021
* The original behaviour seemed a little brittle to me, so I asked for some help
* This new refactor seems a lot cleaner, and deals with the handling of getting a nil response a lot cleaner
* Specs edited to add in two types of disconnection errors: getaddrinfo for non-existent DNS and ECONNREFUSED for when connection refused
* Credit: https://codereview.stackexchange.com/questions/163727/redis-lookup-with-a-default-value/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants