diff options
author | Pratik Naik <pratiknaik@gmail.com> | 2009-04-22 15:26:03 +0100 |
---|---|---|
committer | Pratik Naik <pratiknaik@gmail.com> | 2009-04-22 15:26:03 +0100 |
commit | 5f3f100ce2d689480da85abc88e5e940cf90189e (patch) | |
tree | 15c1a05a5308a9eea56d7f0889ac46d9cac5b57c /actionpack/test/lib | |
parent | d758d996d1b66e2a65640f79f01ce2ac674d7ed5 (diff) | |
parent | ca49299434bc764b667cd86846d892e91a150ef3 (diff) | |
download | rails-5f3f100ce2d689480da85abc88e5e940cf90189e.tar.gz rails-5f3f100ce2d689480da85abc88e5e940cf90189e.tar.bz2 rails-5f3f100ce2d689480da85abc88e5e940cf90189e.zip |
Merge branch 'master' into active_model
Conflicts:
activeresource/lib/active_resource/validations.rb
Diffstat (limited to 'actionpack/test/lib')
-rw-r--r-- | actionpack/test/lib/fixture_template.rb | 35 |
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 |