Sha256: b05c1cbd8f8dfe2a546e97bd7b033ad7fd340e4a0b079e0a8d76ec66ef30e4f6
Contents?: true
Size: 1.11 KB
Versions: 1
Compression:
Stored size: 1.11 KB
Contents
module WatirSplash # class for common functionality class Util @@ui_test_common_dir = "ui-test-common" class << self # loads ui-test-common/environment.rb # # ui-test-common has to be located at some higher level within directory # structure compared to project/ui-test directory def load_common dir = common_dir puts "Loading ui-test-common from #{dir}..." require File.join(dir, "environment.rb") end private def common_dir Dir.chdir("..") do dirs = Dir.entries(Dir.pwd).find_all {|entry| File.directory?(entry)} if dirs.include?(@@ui_test_common_dir) && File.exists?(@@ui_test_common_dir + "/environment.rb") File.join(Dir.pwd, @@ui_test_common_dir) elsif dirs.include?("..") common_dir else raise "#{@@ui_test_common_dir} directory was not found! It has to exist somewhere higher in directory tree than your project's directory and it has to have environment.rb file in it!" end end end end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
watirsplash-0.1.9 | lib/watirsplash/util.rb |