remarkable_rails 3.1.8 → 3.1.9
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG +91 -88
- data/LICENSE +20 -20
- data/README +80 -80
- data/lib/remarkable_rails/action_controller/base.rb +29 -29
- data/lib/remarkable_rails/action_controller/macro_stubs.rb +459 -457
- data/lib/remarkable_rails/action_controller/matchers/assign_to_matcher.rb +92 -92
- data/lib/remarkable_rails/action_controller/matchers/filter_params_matcher.rb +41 -41
- data/lib/remarkable_rails/action_controller/matchers/redirect_to_matcher.rb +119 -119
- data/lib/remarkable_rails/action_controller/matchers/render_template_matcher.rb +146 -146
- data/lib/remarkable_rails/action_controller/matchers/respond_with_matcher.rb +126 -126
- data/lib/remarkable_rails/action_controller/matchers/route_matcher.rb +135 -109
- data/lib/remarkable_rails/action_controller/matchers/set_cookies_matcher.rb +49 -49
- data/lib/remarkable_rails/action_controller/matchers/set_session_matcher.rb +106 -106
- data/lib/remarkable_rails/action_controller/matchers/set_the_flash_matcher.rb +54 -54
- data/lib/remarkable_rails/action_controller.rb +22 -22
- data/lib/remarkable_rails/action_view/base.rb +7 -7
- data/lib/remarkable_rails/action_view.rb +18 -18
- data/lib/remarkable_rails/active_orm.rb +19 -19
- data/lib/remarkable_rails.rb +30 -30
- data/locale/en.yml +110 -110
- data/spec/action_controller/assign_to_matcher_spec.rb +142 -142
- data/spec/action_controller/filter_params_matcher_spec.rb +64 -64
- data/spec/action_controller/macro_stubs_spec.rb +234 -208
- data/spec/action_controller/redirect_to_matcher_spec.rb +102 -102
- data/spec/action_controller/render_template_matcher_spec.rb +251 -251
- data/spec/action_controller/respond_with_matcher_spec.rb +223 -223
- data/spec/action_controller/route_matcher_spec.rb +96 -79
- data/spec/action_controller/set_cookies_matcher_spec.rb +149 -149
- data/spec/action_controller/set_session_matcher_spec.rb +141 -141
- data/spec/action_controller/set_the_flash_matcher_spec.rb +93 -93
- data/spec/application/application.rb +15 -15
- data/spec/application/tasks_controller.rb +34 -34
- data/spec/functional_builder.rb +88 -88
- data/spec/rcov.opts +2 -2
- data/spec/remarkable_rails_spec.rb +5 -5
- data/spec/spec.opts +4 -4
- data/spec/spec_helper.rb +42 -42
- metadata +7 -7
@@ -1,117 +1,117 @@
|
|
1
|
-
require File.expand_path(File.dirname(__FILE__) + '/../spec_helper')
|
2
|
-
|
3
|
-
describe 'set_the_flash' do
|
4
|
-
include FunctionalBuilder
|
5
|
-
|
6
|
-
describe 'messages' do
|
7
|
-
before(:each) do
|
8
|
-
@matcher = set_the_flash(:notice).to('hi')
|
9
|
-
end
|
10
|
-
|
11
|
-
it 'should contain a description message' do
|
12
|
-
@matcher = set_the_flash(:notice)
|
13
|
-
@matcher.description.should == 'set the flash message notice'
|
14
|
-
|
15
|
-
@matcher.to('hi')
|
16
|
-
@matcher.description.should == 'set the flash message notice to "hi"'
|
17
|
-
end
|
18
|
-
|
19
|
-
it 'should set is_not_empty? message' do
|
20
|
-
build_response
|
21
|
-
@matcher = set_the_flash
|
22
|
-
@matcher.matches?(@controller)
|
23
|
-
@matcher.failure_message.should == 'Expected any flash message to be set, got {}'
|
24
|
-
end
|
25
|
-
|
26
|
-
it 'should set contains_value? message' do
|
27
|
-
build_response { flash[:notice] = 'bye' }
|
28
|
-
@matcher = set_the_flash.to('hi')
|
29
|
-
@matcher.matches?(@controller)
|
30
|
-
@matcher.failure_message.should == 'Expected any flash message to be set to "hi", got {:notice=>"bye"}'
|
31
|
-
end
|
32
|
-
|
33
|
-
it 'should set assigned_value? message' do
|
34
|
-
build_response
|
35
|
-
@matcher = set_the_flash(:notice)
|
36
|
-
@matcher.matches?(@controller)
|
37
|
-
@matcher.failure_message.should == 'Expected flash message notice to be set, got {}'
|
38
|
-
end
|
39
|
-
|
40
|
-
it 'should set is_equal_value? message' do
|
41
|
-
build_response { flash[:notice] = 'bye' }
|
42
|
-
@matcher.matches?(@controller)
|
43
|
-
@matcher.failure_message.should == 'Expected flash message notice to be set to "hi", got {:notice=>"bye"}'
|
44
|
-
end
|
45
|
-
end
|
46
|
-
|
47
|
-
describe 'matcher' do
|
48
|
-
before(:each) { build_response { flash[:notice] = 'jose' } }
|
49
|
-
|
50
|
-
it { should set_the_flash }
|
1
|
+
require File.expand_path(File.dirname(__FILE__) + '/../spec_helper')
|
2
|
+
|
3
|
+
describe 'set_the_flash' do
|
4
|
+
include FunctionalBuilder
|
5
|
+
|
6
|
+
describe 'messages' do
|
7
|
+
before(:each) do
|
8
|
+
@matcher = set_the_flash(:notice).to('hi')
|
9
|
+
end
|
10
|
+
|
11
|
+
it 'should contain a description message' do
|
12
|
+
@matcher = set_the_flash(:notice)
|
13
|
+
@matcher.description.should == 'set the flash message notice'
|
14
|
+
|
15
|
+
@matcher.to('hi')
|
16
|
+
@matcher.description.should == 'set the flash message notice to "hi"'
|
17
|
+
end
|
18
|
+
|
19
|
+
it 'should set is_not_empty? message' do
|
20
|
+
build_response
|
21
|
+
@matcher = set_the_flash
|
22
|
+
@matcher.matches?(@controller)
|
23
|
+
@matcher.failure_message.should == 'Expected any flash message to be set, got {}'
|
24
|
+
end
|
25
|
+
|
26
|
+
it 'should set contains_value? message' do
|
27
|
+
build_response { flash[:notice] = 'bye' }
|
28
|
+
@matcher = set_the_flash.to('hi')
|
29
|
+
@matcher.matches?(@controller)
|
30
|
+
@matcher.failure_message.should == 'Expected any flash message to be set to "hi", got {:notice=>"bye"}'
|
31
|
+
end
|
32
|
+
|
33
|
+
it 'should set assigned_value? message' do
|
34
|
+
build_response
|
35
|
+
@matcher = set_the_flash(:notice)
|
36
|
+
@matcher.matches?(@controller)
|
37
|
+
@matcher.failure_message.should == 'Expected flash message notice to be set, got {}'
|
38
|
+
end
|
39
|
+
|
40
|
+
it 'should set is_equal_value? message' do
|
41
|
+
build_response { flash[:notice] = 'bye' }
|
42
|
+
@matcher.matches?(@controller)
|
43
|
+
@matcher.failure_message.should == 'Expected flash message notice to be set to "hi", got {:notice=>"bye"}'
|
44
|
+
end
|
45
|
+
end
|
46
|
+
|
47
|
+
describe 'matcher' do
|
48
|
+
before(:each) { build_response { flash[:notice] = 'jose' } }
|
49
|
+
|
50
|
+
it { should set_the_flash }
|
51
51
|
it { should set_the_flash.to('jose') }
|
52
|
-
it { should set_the_flash.to(/jose/) }
|
53
|
-
it { should set_the_flash(:notice) }
|
52
|
+
it { should set_the_flash.to(/jose/) }
|
53
|
+
it { should set_the_flash(:notice) }
|
54
54
|
it { should set_the_flash(:notice).to('jose') }
|
55
|
-
it { should set_the_flash(:notice).to(/jose/) }
|
56
|
-
|
55
|
+
it { should set_the_flash(:notice).to(/jose/) }
|
56
|
+
|
57
57
|
it { should_not set_the_flash.to('joseph') }
|
58
|
-
it { should_not set_the_flash.to(/joseph/) }
|
59
|
-
it { should_not set_the_flash(:error) }
|
58
|
+
it { should_not set_the_flash.to(/joseph/) }
|
59
|
+
it { should_not set_the_flash(:error) }
|
60
60
|
it { should_not set_the_flash(:notice).to('joseph') }
|
61
|
-
it { should_not set_the_flash(:notice).to(/joseph/) }
|
61
|
+
it { should_not set_the_flash(:notice).to(/joseph/) }
|
62
62
|
|
63
63
|
it { should set_the_flash{ 'jose' } }
|
64
|
-
it { should set_the_flash{ /jose/ } }
|
64
|
+
it { should set_the_flash{ /jose/ } }
|
65
65
|
it { should set_the_flash(:notice){ 'jose' } }
|
66
|
-
it { should set_the_flash(:notice){ /jose/ } }
|
66
|
+
it { should set_the_flash(:notice){ /jose/ } }
|
67
67
|
it { should set_the_flash(:notice, :to => proc{ 'jose' }) }
|
68
|
-
it { should set_the_flash(:notice, :to => proc{ /jose/ }) }
|
69
|
-
|
70
|
-
it { should_not set_the_flash(:notice).to(nil) }
|
68
|
+
it { should set_the_flash(:notice, :to => proc{ /jose/ }) }
|
69
|
+
|
70
|
+
it { should_not set_the_flash(:notice).to(nil) }
|
71
71
|
it { should_not set_the_flash(:notice){ 'joseph' } }
|
72
|
-
it { should_not set_the_flash(:notice){ /joseph/ } }
|
72
|
+
it { should_not set_the_flash(:notice){ /joseph/ } }
|
73
73
|
it { should_not set_the_flash(:notice, :to => proc{ 'joseph' }) }
|
74
|
-
it { should_not set_the_flash(:notice, :to => proc{ /joseph/ }) }
|
75
|
-
end
|
76
|
-
|
77
|
-
describe 'macro' do
|
78
|
-
before(:each) { build_response { flash[:notice] = 'jose' } }
|
79
|
-
|
80
|
-
should_set_the_flash
|
74
|
+
it { should_not set_the_flash(:notice, :to => proc{ /joseph/ }) }
|
75
|
+
end
|
76
|
+
|
77
|
+
describe 'macro' do
|
78
|
+
before(:each) { build_response { flash[:notice] = 'jose' } }
|
79
|
+
|
80
|
+
should_set_the_flash
|
81
81
|
should_set_the_flash :to => 'jose'
|
82
|
-
should_set_the_flash :to => /jose/
|
83
|
-
should_set_the_flash :notice
|
82
|
+
should_set_the_flash :to => /jose/
|
83
|
+
should_set_the_flash :notice
|
84
84
|
should_set_the_flash :notice, :to => 'jose'
|
85
85
|
should_set_the_flash :notice, :to => /jose/
|
86
86
|
|
87
87
|
should_not_set_the_flash :to => 'joseph'
|
88
|
-
should_not_set_the_flash :to => /joseph/
|
89
|
-
should_not_set_the_flash :error
|
88
|
+
should_not_set_the_flash :to => /joseph/
|
89
|
+
should_not_set_the_flash :error
|
90
90
|
should_not_set_the_flash :notice, :to => 'joseph'
|
91
|
-
should_not_set_the_flash :notice, :to => /joseph/
|
92
|
-
|
91
|
+
should_not_set_the_flash :notice, :to => /joseph/
|
92
|
+
|
93
93
|
should_set_the_flash(:notice){ 'jose' }
|
94
|
-
should_set_the_flash(:notice){ /jose/ }
|
94
|
+
should_set_the_flash(:notice){ /jose/ }
|
95
95
|
should_set_the_flash :notice, :to => proc{ 'jose' }
|
96
96
|
should_set_the_flash :notice, :to => proc{ /jose/ }
|
97
97
|
|
98
98
|
should_set_the_flash :notice do |m|
|
99
99
|
m.to = /jose/
|
100
|
-
end
|
101
|
-
|
102
|
-
should_not_set_the_flash :notice, :to => nil
|
100
|
+
end
|
101
|
+
|
102
|
+
should_not_set_the_flash :notice, :to => nil
|
103
103
|
should_not_set_the_flash(:notice){ 'joseph' }
|
104
|
-
should_not_set_the_flash(:notice){ /joseph/ }
|
104
|
+
should_not_set_the_flash(:notice){ /joseph/ }
|
105
105
|
should_not_set_the_flash :notice, :to => proc{ 'joseph' }
|
106
|
-
should_not_set_the_flash :notice, :to => proc{ /joseph/ }
|
107
|
-
end
|
108
|
-
|
109
|
-
describe 'with no parameter' do
|
110
|
-
before(:each) { build_response }
|
111
|
-
|
112
|
-
should_not_set_the_flash
|
113
|
-
it { should_not set_the_flash }
|
114
|
-
end
|
115
|
-
|
116
|
-
generate_macro_stubs_specs_for(:set_the_flash)
|
117
|
-
end
|
106
|
+
should_not_set_the_flash :notice, :to => proc{ /joseph/ }
|
107
|
+
end
|
108
|
+
|
109
|
+
describe 'with no parameter' do
|
110
|
+
before(:each) { build_response }
|
111
|
+
|
112
|
+
should_not_set_the_flash
|
113
|
+
it { should_not set_the_flash }
|
114
|
+
end
|
115
|
+
|
116
|
+
generate_macro_stubs_specs_for(:set_the_flash)
|
117
|
+
end
|
@@ -1,15 +1,15 @@
|
|
1
|
-
# Create an application controller to satisfy rspec-rails, a dummy controller
|
2
|
-
# and define routes.
|
3
|
-
#
|
4
|
-
class ApplicationController < ActionController::Base
|
5
|
-
end
|
6
|
-
|
7
|
-
class Task; end
|
8
|
-
|
9
|
-
# Define routes
|
10
|
-
ActionController::Routing::Routes.draw do |map|
|
11
|
-
map.resources :projects, :has_many => :tasks
|
12
|
-
map.connect ':controller/:action/:id'
|
13
|
-
map.connect ':controller/:action/:id.:format'
|
14
|
-
end
|
15
|
-
|
1
|
+
# Create an application controller to satisfy rspec-rails, a dummy controller
|
2
|
+
# and define routes.
|
3
|
+
#
|
4
|
+
class ApplicationController < ActionController::Base
|
5
|
+
end
|
6
|
+
|
7
|
+
class Task; end
|
8
|
+
|
9
|
+
# Define routes
|
10
|
+
ActionController::Routing::Routes.draw do |map|
|
11
|
+
map.resources :projects, :has_many => :tasks
|
12
|
+
map.connect ':controller/:action/:id'
|
13
|
+
map.connect ':controller/:action/:id.:format'
|
14
|
+
end
|
15
|
+
|
@@ -1,39 +1,39 @@
|
|
1
|
-
class TasksController < ApplicationController
|
2
|
-
filter_parameter_logging :password
|
3
|
-
|
4
|
-
def index
|
5
|
-
@tasks = Task.find(:all)
|
6
|
-
render :text => 'index'
|
7
|
-
end
|
8
|
-
|
9
|
-
def new
|
10
|
-
render :nothing => true
|
11
|
-
end
|
12
|
-
|
13
|
-
def show
|
1
|
+
class TasksController < ApplicationController
|
2
|
+
filter_parameter_logging :password
|
3
|
+
|
4
|
+
def index
|
5
|
+
@tasks = Task.find(:all)
|
6
|
+
render :text => 'index'
|
7
|
+
end
|
8
|
+
|
9
|
+
def new
|
10
|
+
render :nothing => true
|
11
|
+
end
|
12
|
+
|
13
|
+
def show
|
14
14
|
@task = Task.find(params[:id])
|
15
15
|
|
16
16
|
# Multiple expects
|
17
17
|
Task.count
|
18
18
|
Task.max
|
19
|
-
Task.min
|
20
|
-
|
21
|
-
respond_to do |format|
|
22
|
-
format.html { render :text => 'show' }
|
23
|
-
format.xml { render :xml => @task.to_xml }
|
24
|
-
end
|
25
|
-
end
|
26
|
-
|
27
|
-
def destroy
|
28
|
-
@task = Task.find(params[:id])
|
29
|
-
@task.destroy
|
30
|
-
|
31
|
-
flash[:notice] = "#{@task.title(false).inspect} was removed"
|
32
|
-
session[:last_task_id] = 37
|
33
|
-
|
34
|
-
respond_to do |format|
|
35
|
-
format.html { redirect_to project_tasks_url(10) }
|
36
|
-
format.xml { head :ok }
|
37
|
-
end
|
38
|
-
end
|
39
|
-
end
|
19
|
+
Task.min
|
20
|
+
|
21
|
+
respond_to do |format|
|
22
|
+
format.html { render :text => 'show' }
|
23
|
+
format.xml { render :xml => @task.to_xml }
|
24
|
+
end
|
25
|
+
end
|
26
|
+
|
27
|
+
def destroy
|
28
|
+
@task = Task.find(params[:id])
|
29
|
+
@task.destroy
|
30
|
+
|
31
|
+
flash[:notice] = "#{@task.title(false).inspect} was removed"
|
32
|
+
session[:last_task_id] = 37
|
33
|
+
|
34
|
+
respond_to do |format|
|
35
|
+
format.html { redirect_to project_tasks_url(10) }
|
36
|
+
format.xml { head :ok }
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
data/spec/functional_builder.rb
CHANGED
@@ -1,92 +1,92 @@
|
|
1
|
-
# This is based on Shoulda model builder for Test::Unit.
|
2
|
-
#
|
3
|
-
module FunctionalBuilder
|
4
|
-
def self.included(base)
|
5
|
-
base.class_eval do
|
6
|
-
return unless base.name =~ /^Spec/
|
7
|
-
|
8
|
-
base.controller_name 'application'
|
9
|
-
base.integrate_views false
|
10
|
-
|
11
|
-
after(:each) do
|
12
|
-
if @defined_constants
|
13
|
-
@defined_constants.each do |class_name|
|
14
|
-
Object.send(:remove_const, class_name)
|
15
|
-
end
|
16
|
-
end
|
17
|
-
end
|
18
|
-
end
|
19
|
-
|
20
|
-
base.extend ClassMethods
|
21
|
-
end
|
22
|
-
|
23
|
-
def build_response(&block)
|
24
|
-
klass = defined?(ExamplesController) ? ExamplesController : define_controller('Examples')
|
25
|
-
block ||= lambda { render :nothing => true }
|
26
|
-
klass.class_eval { define_method(:example, &block) }
|
27
|
-
|
28
|
-
@controller = klass.new
|
29
|
-
@request = ActionController::TestRequest.new
|
30
|
-
@response = ActionController::TestResponse.new
|
31
|
-
get :example
|
32
|
-
|
33
|
-
self.class.subject { @controller }
|
34
|
-
end
|
35
|
-
|
36
|
-
def define_controller(class_name, &block)
|
37
|
-
class_name = class_name.to_s
|
38
|
-
class_name << 'Controller' unless class_name =~ /Controller$/
|
39
|
-
define_constant(class_name, ApplicationController, &block)
|
40
|
-
end
|
41
|
-
|
42
|
-
def define_constant(class_name, base, &block)
|
43
|
-
class_name = class_name.to_s.camelize
|
44
|
-
|
45
|
-
klass = Class.new(base)
|
46
|
-
Object.const_set(class_name, klass)
|
47
|
-
|
48
|
-
klass.class_eval(&block) if block_given?
|
49
|
-
|
50
|
-
@defined_constants ||= []
|
51
|
-
@defined_constants << class_name
|
52
|
-
|
53
|
-
klass
|
54
|
-
end
|
55
|
-
|
56
|
-
module ClassMethods
|
57
|
-
def generate_macro_stubs_specs_for(matcher, *args)
|
1
|
+
# This is based on Shoulda model builder for Test::Unit.
|
2
|
+
#
|
3
|
+
module FunctionalBuilder
|
4
|
+
def self.included(base)
|
5
|
+
base.class_eval do
|
6
|
+
return unless base.name =~ /^Spec/
|
7
|
+
|
8
|
+
base.controller_name 'application'
|
9
|
+
base.integrate_views false
|
10
|
+
|
11
|
+
after(:each) do
|
12
|
+
if @defined_constants
|
13
|
+
@defined_constants.each do |class_name|
|
14
|
+
Object.send(:remove_const, class_name)
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
|
20
|
+
base.extend ClassMethods
|
21
|
+
end
|
22
|
+
|
23
|
+
def build_response(&block)
|
24
|
+
klass = defined?(ExamplesController) ? ExamplesController : define_controller('Examples')
|
25
|
+
block ||= lambda { render :nothing => true }
|
26
|
+
klass.class_eval { define_method(:example, &block) }
|
27
|
+
|
28
|
+
@controller = klass.new
|
29
|
+
@request = ActionController::TestRequest.new
|
30
|
+
@response = ActionController::TestResponse.new
|
31
|
+
get :example
|
32
|
+
|
33
|
+
self.class.subject { @controller }
|
34
|
+
end
|
35
|
+
|
36
|
+
def define_controller(class_name, &block)
|
37
|
+
class_name = class_name.to_s
|
38
|
+
class_name << 'Controller' unless class_name =~ /Controller$/
|
39
|
+
define_constant(class_name, ApplicationController, &block)
|
40
|
+
end
|
41
|
+
|
42
|
+
def define_constant(class_name, base, &block)
|
43
|
+
class_name = class_name.to_s.camelize
|
44
|
+
|
45
|
+
klass = Class.new(base)
|
46
|
+
Object.const_set(class_name, klass)
|
47
|
+
|
48
|
+
klass.class_eval(&block) if block_given?
|
49
|
+
|
50
|
+
@defined_constants ||= []
|
51
|
+
@defined_constants << class_name
|
52
|
+
|
53
|
+
klass
|
54
|
+
end
|
55
|
+
|
56
|
+
module ClassMethods
|
57
|
+
def generate_macro_stubs_specs_for(matcher, *args)
|
58
58
|
expectation_args = args.dup
|
59
|
-
options = args.extract_options!
|
59
|
+
options = args.extract_options!
|
60
60
|
stub_args = (args << options.merge(:with_stubs => true))
|
61
|
-
|
62
|
-
describe 'macro stubs' do
|
63
|
-
before(:each) do
|
64
|
-
@controller = TasksController.new
|
65
|
-
@request = ActionController::TestRequest.new
|
66
|
-
@response = ActionController::TestResponse.new
|
67
|
-
end
|
68
|
-
|
69
|
-
expects :new, :on => String, :with => 'ola', :returns => 'ola'
|
70
|
-
get :new
|
71
|
-
|
72
|
-
it 'should run expectations by default' do
|
73
|
-
String.should_receive(:should_receive).with(:new).and_return(@mock=mock('chain'))
|
74
|
-
@mock.should_receive(:with).with('ola').and_return(@mock)
|
75
|
-
@mock.should_receive(:exactly).with(1).and_return(@mock)
|
76
|
-
@mock.should_receive(:times).and_return(@mock)
|
77
|
-
@mock.should_receive(:and_return).with('ola').and_return('ola')
|
78
|
-
|
79
|
-
send(matcher, *expectation_args).matches?(@controller)
|
61
|
+
|
62
|
+
describe 'macro stubs' do
|
63
|
+
before(:each) do
|
64
|
+
@controller = TasksController.new
|
65
|
+
@request = ActionController::TestRequest.new
|
66
|
+
@response = ActionController::TestResponse.new
|
67
|
+
end
|
68
|
+
|
69
|
+
expects :new, :on => String, :with => 'ola', :returns => 'ola'
|
70
|
+
get :new
|
71
|
+
|
72
|
+
it 'should run expectations by default' do
|
73
|
+
String.should_receive(:should_receive).with(:new).and_return(@mock=mock('chain'))
|
74
|
+
@mock.should_receive(:with).with('ola').and_return(@mock)
|
75
|
+
@mock.should_receive(:exactly).with(1).and_return(@mock)
|
76
|
+
@mock.should_receive(:times).and_return(@mock)
|
77
|
+
@mock.should_receive(:and_return).with('ola').and_return('ola')
|
78
|
+
|
79
|
+
send(matcher, *expectation_args).matches?(@controller)
|
80
|
+
end
|
81
|
+
|
82
|
+
it 'should run stubs' do
|
83
|
+
String.should_receive(:stub!).with(:new).and_return(@mock=mock('chain'))
|
84
|
+
@mock.should_receive(:and_return).with('ola').and_return('ola')
|
85
|
+
|
86
|
+
send(matcher, *stub_args).matches?(@controller)
|
80
87
|
end
|
88
|
+
end
|
81
89
|
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
send(matcher, *stub_args).matches?(@controller)
|
87
|
-
end
|
88
|
-
end
|
89
|
-
|
90
|
-
end
|
91
|
-
end
|
92
|
-
end
|
90
|
+
end
|
91
|
+
end
|
92
|
+
end
|
data/spec/rcov.opts
CHANGED
@@ -1,2 +1,2 @@
|
|
1
|
-
--exclude "spec/*,gems/*"
|
2
|
-
--rails
|
1
|
+
--exclude "spec/*,gems/*"
|
2
|
+
--rails
|
@@ -1,11 +1,11 @@
|
|
1
|
-
require File.expand_path(File.dirname(__FILE__) + '/spec_helper')
|
2
|
-
|
3
|
-
describe 'loader' do
|
1
|
+
require File.expand_path(File.dirname(__FILE__) + '/spec_helper')
|
2
|
+
|
3
|
+
describe 'loader' do
|
4
4
|
it "should load files in the plugin folder" do
|
5
5
|
defined?(MyPlugin::Matchers).should == "constant"
|
6
6
|
end
|
7
7
|
|
8
8
|
it "should load files in the plugin folder" do
|
9
9
|
I18n.t("my_plugin_locale").should == "My plugin locale"
|
10
|
-
end
|
11
|
-
end
|
10
|
+
end
|
11
|
+
end
|
data/spec/spec.opts
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
--colour
|
2
|
-
--format progress
|
3
|
-
--loadby mtime
|
4
|
-
--reverse
|
1
|
+
--colour
|
2
|
+
--format progress
|
3
|
+
--loadby mtime
|
4
|
+
--reverse
|
data/spec/spec_helper.rb
CHANGED
@@ -1,46 +1,46 @@
|
|
1
|
-
require 'rubygems'
|
2
|
-
|
3
|
-
RAILS_ENV = 'test'
|
4
|
-
RAILS_VERSION = ENV['RAILS_VERSION'] || '2.3.
|
5
|
-
|
6
|
-
# Load Rails
|
7
|
-
gem 'activesupport', RAILS_VERSION
|
8
|
-
require 'active_support'
|
9
|
-
|
10
|
-
gem 'actionpack', RAILS_VERSION
|
11
|
-
require 'action_controller'
|
12
|
-
|
13
|
-
gem 'actionmailer', RAILS_VERSION
|
14
|
-
require 'action_mailer'
|
15
|
-
|
16
|
-
gem 'rails', RAILS_VERSION
|
17
|
-
require 'rails/version'
|
18
|
-
|
19
|
-
# Load Remarkable core on place to avoid gem to be loaded
|
20
|
-
dir = File.dirname(__FILE__)
|
21
|
-
require File.join(dir, '..', '..', 'remarkable', 'lib', 'remarkable')
|
22
|
-
|
23
|
-
# Add spec/application to load path and set view_paths
|
24
|
-
RAILS_ROOT = File.join(dir, 'application')
|
25
|
-
$:.unshift(RAILS_ROOT)
|
26
|
-
|
27
|
-
ActionController::Base.view_paths = RAILS_ROOT
|
28
|
-
require File.join(RAILS_ROOT, 'application')
|
29
|
-
require File.join(RAILS_ROOT, 'tasks_controller')
|
30
|
-
|
31
|
-
# Load Remarkable Rails
|
32
|
-
require File.join(dir, 'functional_builder')
|
33
|
-
|
1
|
+
require 'rubygems'
|
2
|
+
|
3
|
+
RAILS_ENV = 'test'
|
4
|
+
RAILS_VERSION = ENV['RAILS_VERSION'] || '2.3.3'
|
5
|
+
|
6
|
+
# Load Rails
|
7
|
+
gem 'activesupport', RAILS_VERSION
|
8
|
+
require 'active_support'
|
9
|
+
|
10
|
+
gem 'actionpack', RAILS_VERSION
|
11
|
+
require 'action_controller'
|
12
|
+
|
13
|
+
gem 'actionmailer', RAILS_VERSION
|
14
|
+
require 'action_mailer'
|
15
|
+
|
16
|
+
gem 'rails', RAILS_VERSION
|
17
|
+
require 'rails/version'
|
18
|
+
|
19
|
+
# Load Remarkable core on place to avoid gem to be loaded
|
20
|
+
dir = File.dirname(__FILE__)
|
21
|
+
require File.join(dir, '..', '..', 'remarkable', 'lib', 'remarkable')
|
22
|
+
|
23
|
+
# Add spec/application to load path and set view_paths
|
24
|
+
RAILS_ROOT = File.join(dir, 'application')
|
25
|
+
$:.unshift(RAILS_ROOT)
|
26
|
+
|
27
|
+
ActionController::Base.view_paths = RAILS_ROOT
|
28
|
+
require File.join(RAILS_ROOT, 'application')
|
29
|
+
require File.join(RAILS_ROOT, 'tasks_controller')
|
30
|
+
|
31
|
+
# Load Remarkable Rails
|
32
|
+
require File.join(dir, 'functional_builder')
|
33
|
+
|
34
34
|
# Load spec-rails
|
35
|
-
if ENV['RSPEC_VERSION']
|
35
|
+
if ENV['RSPEC_VERSION']
|
36
36
|
gem 'rspec-rails', ENV['RSPEC_VERSION']
|
37
37
|
else
|
38
38
|
gem 'rspec-rails'
|
39
|
-
end
|
40
|
-
require 'spec/rails'
|
41
|
-
|
42
|
-
require File.join(dir, '..', 'lib', 'remarkable_rails')
|
43
|
-
|
44
|
-
# Register folders to example groups
|
45
|
-
Spec::Example::ExampleGroupFactory.register(:action_controller, Spec::Rails::Example::ControllerExampleGroup)
|
46
|
-
|
39
|
+
end
|
40
|
+
require 'spec/rails'
|
41
|
+
|
42
|
+
require File.join(dir, '..', 'lib', 'remarkable_rails')
|
43
|
+
|
44
|
+
# Register folders to example groups
|
45
|
+
Spec::Example::ExampleGroupFactory.register(:action_controller, Spec::Rails::Example::ControllerExampleGroup)
|
46
|
+
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: remarkable_rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.1.
|
4
|
+
version: 3.1.9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Carlos Brando
|
@@ -10,7 +10,7 @@ autorequire:
|
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
12
|
|
13
|
-
date: 2009-
|
13
|
+
date: 2009-08-30 00:00:00 +02:00
|
14
14
|
default_executable:
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
@@ -39,9 +39,9 @@ dependencies:
|
|
39
39
|
version_requirement:
|
40
40
|
version_requirements: !ruby/object:Gem::Requirement
|
41
41
|
requirements:
|
42
|
-
- -
|
42
|
+
- - ~>
|
43
43
|
- !ruby/object:Gem::Version
|
44
|
-
version: 3.1.
|
44
|
+
version: 3.1.9
|
45
45
|
version:
|
46
46
|
- !ruby/object:Gem::Dependency
|
47
47
|
name: remarkable_activerecord
|
@@ -49,9 +49,9 @@ dependencies:
|
|
49
49
|
version_requirement:
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
|
-
- -
|
52
|
+
- - ~>
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version: 3.1.
|
54
|
+
version: 3.1.9
|
55
55
|
version:
|
56
56
|
description: "Remarkable Rails: collection of matchers and macros with I18n for Rails"
|
57
57
|
email:
|
@@ -110,7 +110,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
110
110
|
requirements: []
|
111
111
|
|
112
112
|
rubyforge_project: remarkable
|
113
|
-
rubygems_version: 1.3.
|
113
|
+
rubygems_version: 1.3.5
|
114
114
|
signing_key:
|
115
115
|
specification_version: 3
|
116
116
|
summary: "Remarkable Rails: collection of matchers and macros with I18n for Rails"
|