1dir = File.dirname(__FILE__)
2$LOAD_PATH.unshift(File.expand_path("#{dir}/../rspec/lib"))
3$LOAD_PATH.unshift(File.expand_path("#{dir}/../spec_resources/controllers"))
4$LOAD_PATH.unshift(File.expand_path("#{dir}/../spec_resources/helpers"))
5require File.expand_path("#{dir}/../../../../spec/spec_helper")
6require File.expand_path("#{dir}/../spec_resources/controllers/render_spec_controller")
7require File.expand_path("#{dir}/../spec_resources/controllers/rjs_spec_controller")
8require File.expand_path("#{dir}/../spec_resources/controllers/redirect_spec_controller")
9require File.expand_path("#{dir}/../spec_resources/controllers/action_view_base_spec_controller")
10require File.expand_path("#{dir}/../spec_resources/helpers/explicit_helper")
11require File.expand_path("#{dir}/../spec_resources/helpers/more_explicit_helper")
12require File.expand_path("#{dir}/../spec_resources/helpers/view_spec_helper")
13require File.expand_path("#{dir}/../spec_resources/helpers/plugin_application_helper")
14
15ActionController::Routing.controller_paths << "#{dir}/../spec_resources/controllers"
16
17module Spec
18 module Rails
19 module Example
20 class ViewExampleGroupController
21 set_view_path File.join(File.dirname(__FILE__), "..", "spec_resources", "views")
22 end
23 end
24 end
25end
26
27def fail()
28 raise_error(Spec::Expectations::ExpectationNotMetError)
29end
30
31def fail_with(message)
32 raise_error(Spec::Expectations::ExpectationNotMetError,message)
33end
34
35class Proc
36 def should_pass
37 lambda { self.call }.should_not raise_error
38 end
39end
40
41ActionController::Routing::Routes.draw do |map|
42 map.resources :rspec_on_rails_specs
43 map.connect 'custom_route', :controller => 'custom_route_spec', :action => 'custom_route'
44 map.connect ":controller/:action/:id"
45end
46