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

test cyclic includes #101

Merged
merged 6 commits into from
Feb 26, 2014
Merged

test cyclic includes #101

merged 6 commits into from
Feb 26, 2014

Conversation

mvidner
Copy link
Member

@mvidner mvidner commented Feb 18, 2014

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.

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
Copy link
Member

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

@jreidinger
Copy link
Member

@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 )

@mvidner
Copy link
Member Author

mvidner commented Feb 26, 2014

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.

@jreidinger
Copy link
Member

@mvidner done + use format doc for rspec.

jreidinger added a commit that referenced this pull request Feb 26, 2014
@jreidinger jreidinger merged commit f9cfe23 into master Feb 26, 2014
@jreidinger jreidinger deleted the fix_endless_loop branch February 26, 2014 09:30
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