-
Notifications
You must be signed in to change notification settings - Fork 14
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
test cyclic includes #101
test cyclic includes #101
Conversation
module Yast | ||
describe ".include" do | ||
it "does not loop endlessly on cyclic includes" do | ||
expect { Yast.include(Yast, "cyclic_yin.rb") }.not_to raise_error |
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.
only annoying part is that it modify Yast module. maybe better use new class to avoid possible problems in other tests. also I think that this belongs to yast_spec.rb
file as it test Yast.include
@mvidner I update code, please can you check it if you agree with it? ( ruby dynamic class creation is maybe little magic, but one test do not modify others ) |
Thank you! As discussed, I disliked the metaprogramming at first, but I concede that it is just a small amount of easy magic, which indeed helps code locality. Please make yast_spec.rb executable, then LGTM. |
@mvidner done + use format doc for rspec. |
This is an after-hotfix amendment to #100. @jreidinger what do you think? I have verified that this test fails when cherry-picked before 100 is applied.