-
Notifications
You must be signed in to change notification settings - Fork 42
Fixes for Ruby 3.2 #372
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
Fixes for Ruby 3.2 #372
Conversation
This resolves the flaky behaviour in CI.
Different versions of Ruby provide different error messages.
This avoids failing specs in development environments where the default region is not us-east-1.
| before do | ||
| allow(File).to receive(:read).and_return('file content') | ||
| end | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Avoid stubbing File.read. This resolves the flaky behaviour in CI.
| allow_any_instance_of(described_class).to receive(:`).with("op --version").and_return(true) | ||
| allow_any_instance_of(described_class).to receive(:`).with("op get item --vault='Shared' 'password title' 2>&1").and_return('{key: value }') | ||
| expect { resolver.resolve(the_password) }.to raise_error(StackMaster::ParameterResolvers::OnePassword::OnePasswordInvalidResponse, /Failed to parse JSON returned, {key: value }: \d+: unexpected token at '{key: value }'/) | ||
| expect { resolver.resolve(the_password) }.to raise_error(StackMaster::ParameterResolvers::OnePassword::OnePasswordInvalidResponse, /Failed to parse JSON returned, {key: value }:.* unexpected token at '{key: value }'/) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Be more lenient with the error message expectation here. Different versions of Ruby provide slightly different error messages.
| let(:outputs) { [] } | ||
|
|
||
| before do | ||
| allow(StackMaster.cloud_formation_driver).to receive(:region).and_return(region) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Stub out the default AWS region. This prevents specs failing in development environments where the default
region is not us-east-1.
petervandoros
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👍
stergiom
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚀
Context
Ruby 3.2 has been released! Let's get Stack Master working on this.
Change
File.exists?withFile.exist?. This is the only change to files included in the gem.