Skip to content

Commit

Permalink
test cyclic includes
Browse files Browse the repository at this point in the history
  • Loading branch information
mvidner committed Feb 18, 2014
1 parent a711295 commit b839ff5
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 0 deletions.
13 changes: 13 additions & 0 deletions tests/ruby/include_spec.rb
@@ -0,0 +1,13 @@
#!/usr/bin/env rspec

require_relative "test_helper_rspec"

require "yast"

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
end
end
end
11 changes: 11 additions & 0 deletions tests/ruby/test_module/include/cyclic_yang.rb
@@ -0,0 +1,11 @@
module Yast
module CyclicYangInclude
def initialize_cyclic_yang(include_target)
Yast.include include_target, "cyclic_yin.rb"
end

def yang
"YANG"
end
end
end
11 changes: 11 additions & 0 deletions tests/ruby/test_module/include/cyclic_yin.rb
@@ -0,0 +1,11 @@
module Yast
module CyclicYinInclude
def initialize_cyclic_yin(include_target)
Yast.include include_target, "cyclic_yang.rb"
end

def yin
"YIN"
end
end
end

0 comments on commit b839ff5

Please sign in to comment.