Skip to content

Commit

Permalink
Add a Gemfile.
Browse files Browse the repository at this point in the history
Use the full path to the lib directory when running tests from Rake to
avoid an 'insecure operation - require' error on Ruby 1.8.7 caused by
bundler adding a tainted lib directory to the load path.
  • Loading branch information
philr committed Sep 8, 2013
1 parent 822601e commit 160654e
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 1 deletion.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
doc
pkg
Gemfile.lock
7 changes: 7 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
source "https://rubygems.org"

gemspec

group :test do
gem 'rake'
end
5 changes: 4 additions & 1 deletion Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ begin
rescue LoadError, RuntimeError
end

BASE_DIR = File.expand_path(File.dirname(__FILE__))

task :default => [:test]

spec = eval(File.read('tzinfo.gemspec'))
Expand Down Expand Up @@ -105,7 +107,8 @@ def setup_tests(test_task, type)
# timezone isn't GMT). This won't work on Windows.
ENV['TZ'] = 'America/Los_Angeles'

test_task.pattern = File.join(File.expand_path(File.dirname(__FILE__)), 'test', "ts_all_#{type}.rb")
test_task.libs = [File.join(BASE_DIR, 'lib')]
test_task.pattern = File.join(BASE_DIR, 'test', "ts_all_#{type}.rb")
end

Rake::TestTask.new(:test_ruby) do |t|
Expand Down

0 comments on commit 160654e

Please sign in to comment.