aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test/lib
diff options
context:
space:
mode:
authorYehuda Katz and Carl Lerche <wycats@gmail.com>2009-03-23 15:45:01 -0700
committerYehuda Katz and Carl Lerche <wycats@gmail.com>2009-03-23 15:45:01 -0700
commita501638e9dcf55e45613637c52e4169b6324f285 (patch)
treeafc99eff992a16b6b328563eb9db8cf707686cf2 /actionpack/test/lib
parent34f058e082754bb726a4753fa26e8e8c082702c0 (diff)
downloadrails-a501638e9dcf55e45613637c52e4169b6324f285.tar.gz
rails-a501638e9dcf55e45613637c52e4169b6324f285.tar.bz2
rails-a501638e9dcf55e45613637c52e4169b6324f285.zip
Checkpoint
Diffstat (limited to 'actionpack/test/lib')
-rw-r--r--actionpack/test/lib/fixture_template.rb35
1 files changed, 35 insertions, 0 deletions
diff --git a/actionpack/test/lib/fixture_template.rb b/actionpack/test/lib/fixture_template.rb
new file mode 100644
index 0000000000..26f6ec2d0c
--- /dev/null
+++ b/actionpack/test/lib/fixture_template.rb
@@ -0,0 +1,35 @@
+module ActionView #:nodoc:
+ class FixtureTemplate < Template
+ class FixturePath < Template::Path
+ def initialize(hash = {})
+ @hash = {}
+
+ hash.each do |k, v|
+ @hash[k.sub(/\.\w+$/, '')] = FixtureTemplate.new(v, k.split("/").last, self)
+ end
+
+ super("fixtures://root")
+ end
+
+ def find_template(path)
+ @hash[path]
+ end
+ end
+
+ def initialize(body, *args)
+ @body = body
+ super(*args)
+ end
+
+ def source
+ @body
+ end
+
+ private
+
+ def find_full_path(path, load_paths)
+ return '/', path
+ end
+
+ end
+end \ No newline at end of file