aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test
diff options
context:
space:
mode:
authorAaron Patterson <aaron.patterson@gmail.com>2012-10-17 11:30:08 -0700
committerAaron Patterson <aaron.patterson@gmail.com>2012-10-17 11:30:08 -0700
commitd410ac5136ee2c654b3922622bb2c270954acc9b (patch)
treed2d0798fc35b3e3033bdaa2f037f6060f18f8728 /actionpack/test
parentbf876af7b33b8f6a4c91353e2751686f1d0fa934 (diff)
downloadrails-d410ac5136ee2c654b3922622bb2c270954acc9b.tar.gz
rails-d410ac5136ee2c654b3922622bb2c270954acc9b.tar.bz2
rails-d410ac5136ee2c654b3922622bb2c270954acc9b.zip
use the tmp filesystem rather than our own thing.
Diffstat (limited to 'actionpack/test')
-rw-r--r--actionpack/test/template/digestor_test.rb14
1 files changed, 9 insertions, 5 deletions
diff --git a/actionpack/test/template/digestor_test.rb b/actionpack/test/template/digestor_test.rb
index 8181aa11f7..b9d26da3af 100644
--- a/actionpack/test/template/digestor_test.rb
+++ b/actionpack/test/template/digestor_test.rb
@@ -13,20 +13,24 @@ end
class FixtureFinder
FIXTURES_DIR = "#{File.dirname(__FILE__)}/../fixtures/digestor"
- TMP_DIR = "#{File.dirname(__FILE__)}/../tmp"
def find(logical_name, keys, partial, options)
- FixtureTemplate.new("#{TMP_DIR}/digestor/#{partial ? logical_name.gsub(%r|/([^/]+)$|, '/_\1') : logical_name}.#{options[:formats].first}.erb")
+ FixtureTemplate.new("digestor/#{partial ? logical_name.gsub(%r|/([^/]+)$|, '/_\1') : logical_name}.#{options[:formats].first}.erb")
end
end
class TemplateDigestorTest < ActionView::TestCase
def setup
- FileUtils.cp_r FixtureFinder::FIXTURES_DIR, FixtureFinder::TMP_DIR
+ @cwd = Dir.pwd
+ @tmp_dir = Dir.mktmpdir
+
+ FileUtils.cp_r FixtureFinder::FIXTURES_DIR, @tmp_dir
+ Dir.chdir @tmp_dir
end
def teardown
- FileUtils.rm_r File.join(FixtureFinder::TMP_DIR, "digestor")
+ Dir.chdir @cwd
+ FileUtils.rm_r @tmp_dir
ActionView::Digestor.cache.clear
end
@@ -159,7 +163,7 @@ class TemplateDigestorTest < ActionView::TestCase
end
def change_template(template_name)
- File.open("#{FixtureFinder::TMP_DIR}/digestor/#{template_name}.html.erb", "w") do |f|
+ File.open("digestor/#{template_name}.html.erb", "w") do |f|
f.write "\nTHIS WAS CHANGED!"
end
end