From cd48af7eb031b839cf326305c224e2ff000cd3ab Mon Sep 17 00:00:00 2001 From: Luke Kanies Date: Mon, 27 Jun 2005 21:48:39 +0000 Subject: renaming blink to puppet git-svn-id: https://reductivelabs.com/svn/puppet/library/trunk@306 980ebf18-57e1-0310-9a29-db15c13687c0 --- test/blinktest.rb | 57 ------------------------------------------------------- test/puppetest.rb | 57 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ test/test | 10 +++++----- 3 files changed, 62 insertions(+), 62 deletions(-) delete mode 100644 test/blinktest.rb create mode 100644 test/puppetest.rb diff --git a/test/blinktest.rb b/test/blinktest.rb deleted file mode 100644 index a20e35079..000000000 --- a/test/blinktest.rb +++ /dev/null @@ -1,57 +0,0 @@ -# $Id$ - -unless defined? PuppetTestSuite - $VERBOSE = true - - $:.unshift File.join(Dir.getwd, '../lib') - - class PuppetTestSuite - attr_accessor :subdir - - def PuppetTestSuite.list - Dir.entries(".").find_all { |file| - FileTest.directory?(file) and file !~ /^\./ - } - end - - def initialize(name) - unless FileTest.directory?(name) - puts "TestSuites are directories containing test cases" - puts "no such directory: %s" % name - exit(65) - end - - # load each of the files - Dir.entries(name).collect { |file| - File.join(name,file) - }.find_all { |file| - FileTest.file?(file) and file =~ /tc_.+\.rb$/ - }.sort { |a,b| - # in the order they were modified, so the last modified files - # are loaded and thus displayed last - File.stat(b) <=> File.stat(a) - }.each { |file| - require file - } - end - end - - def textfiles - textdir = File.join($puppetbase,"examples","code") - # only parse this one file now - yield File.join(textdir,"head") - return - files = Dir.entries(textdir).reject { |file| - file =~ %r{\.swp} - }.reject { |file| - file =~ %r{\.disabled} - }.collect { |file| - File.join(textdir,file) - }.find_all { |file| - FileTest.file?(file) - }.sort.each { |file| - puts "Processing %s" % file - yield file - } - end -end diff --git a/test/puppetest.rb b/test/puppetest.rb new file mode 100644 index 000000000..a20e35079 --- /dev/null +++ b/test/puppetest.rb @@ -0,0 +1,57 @@ +# $Id$ + +unless defined? PuppetTestSuite + $VERBOSE = true + + $:.unshift File.join(Dir.getwd, '../lib') + + class PuppetTestSuite + attr_accessor :subdir + + def PuppetTestSuite.list + Dir.entries(".").find_all { |file| + FileTest.directory?(file) and file !~ /^\./ + } + end + + def initialize(name) + unless FileTest.directory?(name) + puts "TestSuites are directories containing test cases" + puts "no such directory: %s" % name + exit(65) + end + + # load each of the files + Dir.entries(name).collect { |file| + File.join(name,file) + }.find_all { |file| + FileTest.file?(file) and file =~ /tc_.+\.rb$/ + }.sort { |a,b| + # in the order they were modified, so the last modified files + # are loaded and thus displayed last + File.stat(b) <=> File.stat(a) + }.each { |file| + require file + } + end + end + + def textfiles + textdir = File.join($puppetbase,"examples","code") + # only parse this one file now + yield File.join(textdir,"head") + return + files = Dir.entries(textdir).reject { |file| + file =~ %r{\.swp} + }.reject { |file| + file =~ %r{\.disabled} + }.collect { |file| + File.join(textdir,file) + }.find_all { |file| + FileTest.file?(file) + }.sort.each { |file| + puts "Processing %s" % file + yield file + } + end +end diff --git a/test/test b/test/test index 14301cf4c..0ded96f9b 100755 --- a/test/test +++ b/test/test @@ -9,12 +9,12 @@ $:.unshift '.' $:.unshift '../lib' # if we're not in the library trunk, then add that to the lib search path -if Dir.getwd !~ %r{blink/library} +if Dir.getwd !~ %r{puppet/library} $:.unshift '../../../library/trunk/lib/' $:.unshift '../../../library/trunk/test/' end -require 'blinktest.rb' +require 'puppetest.rb' require 'getoptlong' @@ -35,16 +35,16 @@ result.each { |opt,arg| end } -$blinkbase = "../../../language/trunk" +$puppetbase = "../../../language/trunk" suites = nil if ARGV.length != 0 suites = ARGV else - suites = BlinkTestSuite.list + suites = PuppetTestSuite.list end suites.each { |suite| - BlinkTestSuite.new(suite) + PuppetTestSuite.new(suite) } -- cgit