Updated to latest rspec
[gitorious:georgyos-clone.git] / vendor / plugins / rspec-rails / spec / spec_helper.rb
1 dir = 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"))
5 require File.expand_path("#{dir}/../../../../spec/spec_helper")
6 require File.expand_path("#{dir}/../spec_resources/controllers/render_spec_controller")
7 require File.expand_path("#{dir}/../spec_resources/controllers/rjs_spec_controller")
8 require File.expand_path("#{dir}/../spec_resources/controllers/redirect_spec_controller")
9 require File.expand_path("#{dir}/../spec_resources/controllers/action_view_base_spec_controller")
10 require File.expand_path("#{dir}/../spec_resources/helpers/explicit_helper")
11 require File.expand_path("#{dir}/../spec_resources/helpers/more_explicit_helper")
12 require File.expand_path("#{dir}/../spec_resources/helpers/view_spec_helper")
13 require File.expand_path("#{dir}/../spec_resources/helpers/plugin_application_helper")
14
15 ActionController::Routing.controller_paths << "#{dir}/../spec_resources/controllers"
16
17 module 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
25 end
26
27 def fail()
28   raise_error(Spec::Expectations::ExpectationNotMetError)
29 end
30   
31 def fail_with(message)
32   raise_error(Spec::Expectations::ExpectationNotMetError,message)
33 end
34
35 class Proc
36   def should_pass
37     lambda { self.call }.should_not raise_error
38   end
39 end
40
41 ActionController::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"
45 end
46