diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2011-07-23 20:59:54 -0700 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2011-07-25 09:07:46 -0700 |
commit | 36fd3fdf46f6733b9a626401eaeaca1f5dfbd083 (patch) | |
tree | f554a6a273797e568bc2706c12bdc9f6b587a16d /actionpack | |
parent | b033a248146d53c65a1680cdeb76b2035e670dfd (diff) | |
download | rails-36fd3fdf46f6733b9a626401eaeaca1f5dfbd083.tar.gz rails-36fd3fdf46f6733b9a626401eaeaca1f5dfbd083.tar.bz2 rails-36fd3fdf46f6733b9a626401eaeaca1f5dfbd083.zip |
no need for an anonymous class on every setup call
Diffstat (limited to 'actionpack')
-rw-r--r-- | actionpack/test/template/sprockets_helper_test.rb | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/actionpack/test/template/sprockets_helper_test.rb b/actionpack/test/template/sprockets_helper_test.rb index 1135c55ff0..3d7abc7e2a 100644 --- a/actionpack/test/template/sprockets_helper_test.rb +++ b/actionpack/test/template/sprockets_helper_test.rb @@ -4,22 +4,21 @@ require 'sprockets/helpers/rails_helper' require 'mocha' class SprocketsHelperTest < ActionView::TestCase - tests Sprockets::Helpers::RailsHelper + include Sprockets::Helpers::RailsHelper attr_accessor :assets + class MockRequest + def protocol() 'http://' end + def ssl?() false end + def host_with_port() 'localhost' end + end + def setup super - @controller = BasicController.new - - @request = Class.new do - def protocol() 'http://' end - def ssl?() false end - def host_with_port() 'localhost' end - end.new - - @controller.request = @request + @controller = BasicController.new + @controller.request = MockRequest.new @assets = Sprockets::Environment.new @assets.paths << FIXTURES.join("sprockets/app/javascripts") |