remarkable_rails 3.1.3 → 3.1.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/CHANGELOG CHANGED
@@ -1,48 +1,50 @@
1
- * mock_models now creates a second class method to be used on the index action [#71]
2
- In other words, mock_models :project will create:
1
+ * assert_valid_keys on expects
3
2
 
4
- def self.mock_project
5
- proc { mock_project }
6
- end
7
-
8
- # This was added to be used on index actions
9
- def self.mock_projects
10
- proc { [ mock_project ] }
11
- end
12
-
13
- def mock_project(stubs={})
14
- @project ||= mock_model(Project, stubs)
15
- end
16
-
17
- * Allow multiple args to be given to :with in expects. If you need to verify that
18
- an array is being sent, you need to send an array inside another array [#70]
19
-
20
- * Allow procs or blocks to be given to respond_with_body and respond_with :body [#67]
21
-
22
- * Allow ordered to be given to macro stubs as option [#66]
23
-
24
- # v3.1
25
-
26
- * Ensure set_cookies and set_session work with arrays [#55]
27
-
28
- * Added set_cookies matcher [#51]
29
-
30
- * Add a helper to declare that a XmlHttpRequest should be performed:
31
-
32
- describe :get => :show do
33
- xhr!
34
-
35
- * Macro stubs now supports blocks too [#50]
36
-
37
- expects :human_attribute_name, :on => Project, :with => :title do |attr|
38
- attr.to_s.humanize
39
- end
40
-
41
- * :to option in set_session and set_the_flash now accepts Regexp [#46]
42
-
43
- * render_template now works with partials [#43]
44
-
45
- * Added to support for routing example group (inside spec/routing) [#26]
3
+ * mock_models now creates a second class method to be used on the index action [#71]
4
+ In other words, mock_models :project will create:
5
+
6
+ def self.mock_project
7
+ proc { mock_project }
8
+ end
9
+
10
+ # This was added to be used on index actions
11
+ def self.mock_projects
12
+ proc { [ mock_project ] }
13
+ end
14
+
15
+ def mock_project(stubs={})
16
+ @project ||= mock_model(Project, stubs)
17
+ end
18
+
19
+ * Allow multiple args to be given to :with in expects. If you need to verify that
20
+ an array is being sent, you need to send an array inside another array [#70]
21
+
22
+ * Allow procs or blocks to be given to respond_with_body and respond_with :body [#67]
23
+
24
+ * Allow ordered to be given to macro stubs as option [#66]
25
+
26
+ # v3.1
27
+
28
+ * Ensure set_cookies and set_session work with arrays [#55]
29
+
30
+ * Added set_cookies matcher [#51]
31
+
32
+ * Add a helper to declare that a XmlHttpRequest should be performed:
33
+
34
+ describe :get => :show do
35
+ xhr!
36
+
37
+ * Macro stubs now supports blocks too [#50]
38
+
39
+ expects :human_attribute_name, :on => Project, :with => :title do |attr|
40
+ attr.to_s.humanize
41
+ end
42
+
43
+ * :to option in set_session and set_the_flash now accepts Regexp [#46]
44
+
45
+ * render_template now works with partials [#43]
46
+
47
+ * Added to support for routing example group (inside spec/routing) [#26]
46
48
 
47
49
  # v3.0
48
50
 
@@ -233,6 +233,8 @@ module Remarkable
233
233
  #
234
234
  def expects(*args, &block)
235
235
  options = args.extract_options!
236
+ options.assert_valid_keys(:on, :with, :returns, :times, :ordered)
237
+
236
238
  args.each do |arg|
237
239
  write_inheritable_array(:expects_chain, [ [ arg, options, block] ])
238
240
  end
data/locale/en.yml CHANGED
@@ -71,7 +71,7 @@ en:
71
71
  expectations:
72
72
  map_to_path: "to map {{options}} to {{method}} {{path}}, got {{actual}}"
73
73
  generate_params: "to generate params {{options}} from {{method}} {{path}}, got {{actual}}"
74
-
74
+
75
75
  set_cookies:
76
76
  description: "set cookies {{keys}}"
77
77
  expectations:
@@ -81,8 +81,8 @@ en:
81
81
  is_equal_value: "cookie {{key}} to be set to {{to}}, got {{cookies_inspect}}"
82
82
  optionals:
83
83
  to:
84
- positive: "to {{inspect}}"
85
- negative: "to {{inspect}}"
84
+ positive: "to {{inspect}}"
85
+ negative: "to {{inspect}}"
86
86
 
87
87
  set_session:
88
88
  description: "set session variable {{keys}}"
@@ -93,7 +93,7 @@ en:
93
93
  is_equal_value: "session variable {{key}} to be set to {{to}}, got {{session_inspect}}"
94
94
  optionals:
95
95
  to:
96
- positive: "to {{inspect}}"
96
+ positive: "to {{inspect}}"
97
97
  negative: "to {{inspect}}"
98
98
 
99
99
  set_the_flash:
@@ -105,6 +105,6 @@ en:
105
105
  is_equal_value: "flash message {{key}} to be set to {{to}}, got {{flash_inspect}}"
106
106
  optionals:
107
107
  to:
108
- positive: "to {{inspect}}"
109
- negative: "to {{inspect}}"
108
+ positive: "to {{inspect}}"
109
+ negative: "to {{inspect}}"
110
110
 
@@ -46,7 +46,7 @@ describe 'filter_params' do
46
46
  it { should_not filter_params(:user) }
47
47
  end
48
48
 
49
- describe 'not filtering parameter' do
49
+ describe 'not filtering any parameter' do
50
50
  before(:each) do
51
51
  @controller = define_controller(:Comments).new
52
52
  self.class.subject { @controller }
@@ -125,6 +125,12 @@ describe 'MacroStubs' do
125
125
  @controller.request.method.should == :get
126
126
  @controller.send(:performed?).should be_true
127
127
  end
128
+
129
+ it 'should raise an error if an invalid key is supplied' do
130
+ lambda {
131
+ self.class.expects :find, :on => Task, :and_return => true
132
+ }.should raise_error(ArgumentError, "Unknown key(s): and_return")
133
+ end
128
134
 
129
135
  it 'should use parameters given in params on request' do
130
136
  self.should_receive(:current_id).once.and_return('37')
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.3
4
+ version: 3.1.4
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-05-28 00:00:00 +02:00
13
+ date: 2009-05-29 00:00:00 +02:00
14
14
  default_executable:
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
@@ -41,7 +41,7 @@ dependencies:
41
41
  requirements:
42
42
  - - ">="
43
43
  - !ruby/object:Gem::Version
44
- version: 3.1.3
44
+ version: 3.1.4
45
45
  version:
46
46
  - !ruby/object:Gem::Dependency
47
47
  name: remarkable_activerecord
@@ -51,7 +51,7 @@ dependencies:
51
51
  requirements:
52
52
  - - ">="
53
53
  - !ruby/object:Gem::Version
54
- version: 3.1.3
54
+ version: 3.1.4
55
55
  version:
56
56
  description: "Remarkable Rails: collection of matchers and macros with I18n for Rails"
57
57
  email: