Sha256: 052fc94fc895307304d6616dbbb1652e1ced0c5b91be60f8a301d2d5c3f3e922

Contents?: true

Size: 882 Bytes

Versions: 1

Compression:

Stored size: 882 Bytes

Contents

require 'rubygems'
require 'active_support'
require 'action_view'
require File.join(File.dirname(__FILE__), '..', 'init')

unless defined?(IRB)
  require 'active_support/test_case'
  require 'shoulda'
end

# fake global rails object
Rails = Object.new
Rails.class_eval do
  def root; @pathname ||= Pathname.new('/this/is/just/for/testing/page_title_helper') end
  def env; "test" end
end

# Mock ActionView a bit to allow easy (fake) template assignment
class TestView < ActionView::Base
  def initialize(controller_path = nil, action = nil)
    @controller = ActionView::TestCase::TestController.new
    @controller.controller_path = controller_path
    self.params[:action] = action if action
  end
  
  def controller!(controller_path, action)
    @controller.controller_path = controller_path
    self.params[:action] = action
  end
  
  def controller
    @controller
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
page_title_helper-2.0.0 test/test_helper.rb