test/test_helper.rb in kicker-2.3.1 vs test/test_helper.rb in kicker-2.4.0

- old
+ new

@@ -1,6 +1,29 @@ require 'rubygems' require 'test/spec' require 'mocha' +require 'set' $:.unshift File.expand_path('../../lib', __FILE__) require 'kicker' + +class File + class << self + attr_accessor :existing_files + attr_accessor :use_original_exist + + alias exist_without_stubbing? exist? + def exist?(file) + if use_original_exist + exist_without_stubbing?(file) + else + if existing_files + existing_files.include?(file) + else + raise "Please stub the files you want to exist by setting File.existing_files" + end + end + end + end +end + +File.use_original_exist = true \ No newline at end of file