From a501638e9dcf55e45613637c52e4169b6324f285 Mon Sep 17 00:00:00 2001 From: Yehuda Katz and Carl Lerche Date: Mon, 23 Mar 2009 15:45:01 -0700 Subject: Checkpoint --- actionpack/test/lib/fixture_template.rb | 35 +++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 actionpack/test/lib/fixture_template.rb (limited to 'actionpack/test/lib') 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 -- cgit v1.2.3