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
Make spec testing placeholders in string a shared example #13514
Make spec testing placeholders in string a shared example #13514
Conversation
@@ -23,6 +23,7 @@ | |||
Dir[Rails.root.join("spec/support/**/*.rb")].each { |f| require f } | |||
# include the manageiq-gems-pending matchers | |||
Dir[ManageIQ::Gems::Pending.root.join("spec/support/custom_matchers/*.rb")].each { |f| require f } | |||
Dir[Rails.root.join("spec/shared/**/*.rb")].each { |f| require f } |
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.
Is this really necessary? There's already a /shared
with models/floating_ip.rb
. How is that currently required now? (or is it unused?)
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.
Ugh, you're right, this is not needed. Instead of putting it just into ManageIQ/manageiq-ui-classic#164 I mistakenly put it both into that & this PR. Thanks for noticing that.
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.
Actually, requiring just spec/shared/i18n/*.rb
should be enough.
a8a55fa
to
496cf4d
Compare
@@ -23,6 +23,7 @@ | |||
Dir[Rails.root.join("spec/support/**/*.rb")].each { |f| require f } | |||
# include the manageiq-gems-pending matchers | |||
Dir[ManageIQ::Gems::Pending.root.join("spec/support/custom_matchers/*.rb")].each { |f| require f } | |||
Dir[Rails.root.join("spec/shared/i18n/*.rb")].each { |f| require f } |
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.
Upon reviewing this more and seeing the origin of /shared
(#11414) I think your original line was correct. Let's change this back to just /shared/**/*.rb
and place it right below line 23 (the support one). Then all shared examples here will be available to the core specs (and we'll start consolidating them there, more.
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.
@chrisarcand All right, done.
496cf4d
to
2892e6c
Compare
Some comments on commit mzazrivec@2892e6c spec/shared/i18n/placeholders_spec.rb
|
Checked commit mzazrivec@2892e6c with ruby 2.2.6, rubocop 0.46.0, and haml-lint 0.19.0 |
All the plugins we have (UI Classic, Amazon provider, etc.) would then run this shared example
as a part of their CI suite. This way, the spec doesn't have to test (and potentially fail) all loaded
plugins.