sinatra-rabbit 1.0.5 → 1.0.6

Sign up to get free protection for your applications and to get access to all the features.
data/tests/app_test.rb ADDED
@@ -0,0 +1,72 @@
1
+ require 'rack/test'
2
+ load File.join(File.dirname(__FILE__), 'fixtures.rb')
3
+
4
+ include Rack::Test::Methods
5
+
6
+ def app
7
+ Sample
8
+ end
9
+
10
+ def status
11
+ last_response.status
12
+ end
13
+
14
+ describe Sample do
15
+
16
+ it "should respond with status OK for root" do
17
+ get '/'
18
+ status.must_equal 200
19
+ end
20
+
21
+ it "should respond 400 to index operation for sample collection without param" do
22
+ get '/sample'
23
+ status.must_equal 400
24
+ end
25
+
26
+ it "should respond 200 to index operation for sample collection with param" do
27
+ get '/sample', { :id => :sample }
28
+ status.must_equal 200
29
+ end
30
+
31
+ it "should respond 200 to HEAD request for index operation in sample collection" do
32
+ head '/sample/index'
33
+ status.must_equal 200
34
+ end
35
+
36
+ it "should respond to OPTIONS request for index operation in sample collection" do
37
+ options '/sample/index'
38
+ status.must_equal 200
39
+ allow_header = last_response.headers['Allow'].split(',')
40
+ allow_header.wont_be_empty
41
+ allow_header.must_include 'feature_data:string:optional'
42
+ allow_header.must_include 'id:string:required'
43
+ end
44
+
45
+ it "should respond 200 to show operation for sample collection" do
46
+ get '/sample/100'
47
+ status.must_equal 200
48
+ last_response.body.must_equal '100'
49
+ end
50
+
51
+ it "should respond 201 to delete operation on sample collection" do
52
+ delete '/sample/100'
53
+ status.must_equal 201
54
+ end
55
+
56
+ it "should respond 200 to stop operation with condition routes" do
57
+ get '/sample/100/stop'
58
+ status.must_equal 200
59
+ end
60
+
61
+ it "should respond 200 to sample subcollection index operation" do
62
+ get '/sample/10/subsample/20'
63
+ status.must_equal 200
64
+ end
65
+
66
+ it "should raise an exception when posting data with unknown values" do
67
+ post '/sample', { :id => '1', :arch => '3'}
68
+ last_response.status.must_equal 400
69
+ last_response.body.must_equal "Parameter 'arch' value '3' not found in list of allowed values [1,2]"
70
+ end
71
+
72
+ end
@@ -0,0 +1,75 @@
1
+ require 'rack/test'
2
+ require 'nokogiri'
3
+
4
+ load File.join(File.dirname(__FILE__), 'fixtures.rb')
5
+
6
+ include Rack::Test::Methods
7
+
8
+ def app
9
+ Sample
10
+ end
11
+
12
+ def status
13
+ last_response.status
14
+ end
15
+
16
+ def html
17
+ Nokogiri::HTML(last_response.body)
18
+ end
19
+
20
+ describe 'Documentation' do
21
+
22
+ it "should respond with status OK for root" do
23
+ get '/docs'
24
+ status.must_equal 200
25
+ end
26
+
27
+ it "should return list of collections in entrypoint" do
28
+ get '/docs'
29
+ html.css('html body > h1').text.must_equal 'Sample'
30
+ html.css('html body ul li').wont_be_empty
31
+ html.css('html body ul li a').wont_be_empty
32
+ end
33
+
34
+ it "should return valid collection name when query collection documentation" do
35
+ get '/docs/sample'
36
+ html.css('html body > h1').text.must_equal 'SampleCollection'
37
+ end
38
+
39
+ it "should return valid collection description when query collection documentation" do
40
+ get '/docs/sample'
41
+ html.css('html body > blockquote').text.must_equal 'Test'
42
+ end
43
+
44
+ it "should return valid collection url when query collection documentation" do
45
+ get '/docs/sample'
46
+ html.css('html body > .url').text.must_equal '/sample'
47
+ end
48
+
49
+ it "should return list of features when query collection documentation" do
50
+ get '/docs/sample'
51
+ html.css('html body .features .feature').map { |f| f.text}.must_include 'user_data', 'user_name'
52
+ end
53
+
54
+ it "should return complete list of operations when query collection documentation" do
55
+ get '/docs/sample'
56
+ html.css('html body .operations tr').size.must_equal 7
57
+ end
58
+
59
+ it "should provide valid links from entrypoint to collection" do
60
+ get '/docs'
61
+ html.css('html body ul li a').each do |a|
62
+ get a[:href]
63
+ last_response.status.must_equal 200
64
+ end
65
+ end
66
+
67
+ it "should provide valid links from collection to an operation" do
68
+ get '/docs/sample'
69
+ html.css('html body .operations tbody .name a').each do |a|
70
+ get a[:href]
71
+ last_response.status.must_equal 200
72
+ end
73
+ end
74
+
75
+ end
data/tests/dsl_test.rb ADDED
@@ -0,0 +1,262 @@
1
+ load File.join(File.dirname(__FILE__), 'fixtures.rb')
2
+
3
+ describe Sinatra::Rabbit::DSL do
4
+
5
+ it "should allow to set configuration" do
6
+ Sinatra::Rabbit.configure do
7
+ enable :documentation
8
+ enable :head_routes
9
+ enable :options_routes
10
+ disable :sample_setting
11
+ end
12
+ Sinatra::Rabbit.enabled?(:documentation).must_equal true
13
+ Sinatra::Rabbit.disabled?(:documentation).must_equal false
14
+ Sinatra::Rabbit.enabled?(:sample_setting).must_equal false
15
+ Sinatra::Rabbit.disabled?(:sample_setting).must_equal true
16
+ end
17
+
18
+ it "should allow to set any property" do
19
+ Sinatra::Rabbit.set(:test_property, '1')
20
+ Sinatra::Rabbit.configuration[:test_property].must_equal '1'
21
+ end
22
+
23
+ it "should have collection method" do
24
+ Sample.respond_to?(:collection).must_equal true
25
+ end
26
+
27
+ it "should be Sinatra::Base class" do
28
+ Sample.respond_to?(:configure).must_equal true
29
+ end
30
+
31
+ it "should return list of all collections" do
32
+ Sample.collections.wont_be_empty
33
+ Sample.collections.size.must_equal 3
34
+ end
35
+
36
+ end
37
+
38
+ describe Sinatra::Rabbit::Collection do
39
+
40
+ it "should include SampleCollection and SecondSampleCollection" do
41
+ Sample.collections.wont_be_empty
42
+ Sample.collections.must_include Sinatra::Rabbit::SampleCollection
43
+ Sample.collections.must_include Sinatra::Rabbit::SecondSampleCollection
44
+ end
45
+
46
+ it "should return SampleCollection using .collection method" do
47
+ Sample.collection(:sample).must_equal Sinatra::Rabbit::SampleCollection
48
+ Sample.collection(:non_existing_sample).must_be_nil
49
+ end
50
+
51
+ it 'should return SampleCollection using [] method' do
52
+ Sample[:sample].must_equal Sinatra::Rabbit::SampleCollection
53
+ Sample[:non_existing_sample].must_be_nil
54
+ end
55
+
56
+ it "should allow to register new collection dynamically" do
57
+ Sample.collection(:dynamic) do
58
+ description 'DynamicTest'
59
+ operation :index do
60
+ control do
61
+ status 200
62
+ end
63
+ end
64
+ end
65
+ Sample.collection(:dynamic).must_equal Sinatra::Rabbit::DynamicCollection
66
+ end
67
+
68
+ it "should raise exception when contain control block" do
69
+ lambda {
70
+ Sample.collection(:raise) do
71
+ description 'RaiseTest'
72
+ control do
73
+ status 200
74
+ end
75
+ end
76
+ }.must_raise RuntimeError
77
+ end
78
+
79
+ it "should allow to return base class" do
80
+ Sample.collection(:second_sample).base_class.must_equal Sample
81
+ Sample.collection(:sample).collection(:subsample).base_class.must_equal Sample
82
+ end
83
+
84
+ it "should return correct collection name" do
85
+ Sample.collection(:sample).collection_name.must_equal :sample
86
+ Sample.collection(:second_sample).collection_name.must_equal :second_sample
87
+ end
88
+
89
+ it "should have correct URI set" do
90
+ Sample.collection(:sample).full_path.must_equal '/sample'
91
+ end
92
+
93
+ it "should return correct collection description" do
94
+ Sample.collection(:sample).description.must_equal 'Test'
95
+ Sample.collection(:second_sample).description.must_equal 'SecondTest'
96
+ end
97
+
98
+ it "should return operations and find index operation" do
99
+ Sample.collection(:sample).operations.wont_be_empty
100
+ Sample.collection(:sample).operations.must_include Sinatra::Rabbit::SampleCollection::IndexOperation
101
+ end
102
+
103
+ it "should return operation using [] syntax" do
104
+ Sample[:sample][:index].must_equal Sinatra::Rabbit::SampleCollection::IndexOperation
105
+ end
106
+
107
+ it "should return subcollection using [] syntax" do
108
+ Sample[:sample][:subsample].must_equal Sinatra::Rabbit::SampleCollection::SubsampleCollection
109
+ end
110
+
111
+ it "should return operation from subcollection using the [] syntax" do
112
+ Sample[:sample][:subsample][:start].must_equal Sinatra::Rabbit::SampleCollection::SubsampleCollection::StartOperation
113
+ end
114
+
115
+ it "should allow to define subcollection" do
116
+ Sample.collection(:sample).collections.wont_be_empty
117
+ Sample.collection(:sample).collections.must_include Sinatra::Rabbit::SampleCollection::SubsampleCollection
118
+ end
119
+
120
+ it "should allow to retrieve subcollection from collection" do
121
+ Sample.collection(:sample).collection(:subsample).must_equal Sinatra::Rabbit::SampleCollection::SubsampleCollection
122
+ end
123
+
124
+ it "should allow to retrieve subcollection parent collection" do
125
+ Sample.collection(:sample).collection(:subsample).parent_collection.must_equal Sinatra::Rabbit::SampleCollection
126
+ end
127
+
128
+ it "should allow to get all operations defined for subcollection" do
129
+ Sample.collection(:sample).collection(:subsample).operations.must_include Sinatra::Rabbit::SampleCollection::SubsampleCollection::ShowOperation
130
+ Sample.collection(:sample).collection(:subsample).operations.must_include Sinatra::Rabbit::SampleCollection::SubsampleCollection::StartOperation
131
+ end
132
+
133
+ it "should have correct URI set for operations in subcollection" do
134
+ Sample.collection(:sample).collection(:subsample).operation(:show).full_path.must_equal '/sample/:id/subsample/:sub_id'
135
+ Sample.collection(:sample).collection(:subsample).operation(:start).full_path.must_equal '/sample/:id/subsample/:sub_id/start'
136
+ end
137
+
138
+ it "should have correct URI set for subcollection" do
139
+ Sample.collection(:sample).collection(:subsample).full_path.must_equal '/sample/:id/subsample'
140
+ end
141
+
142
+ it "should allow to have deeper subcollections" do
143
+ Sample.collection(:sample).collection(:subsample).collection(:secondsubsample).must_equal Sinatra::Rabbit::SampleCollection::SubsampleCollection::SecondsubsampleCollection
144
+ end
145
+
146
+ end
147
+
148
+ describe Sinatra::Rabbit::Collection::Operation do
149
+
150
+ it "should have the :restart action" do
151
+ Sample.collection(:second_sample).operation(:restart).must_equal Sinatra::Rabbit::SecondSampleCollection::RestartOperation
152
+ Sample.collection(:second_sample).operation(:restart).full_path.must_equal '/second_sample/:id/restart'
153
+ Sample.collection(:second_sample).operation(:restart).http_method.must_equal :post
154
+ end
155
+
156
+ it "should return :index operation" do
157
+ Sample.collection(:sample).operation(:index).must_equal Sinatra::Rabbit::SampleCollection::IndexOperation
158
+ end
159
+
160
+ it "should return correct name" do
161
+ Sample.collection(:sample).operation(:index).operation_name.must_equal :index
162
+ end
163
+
164
+ it "should return correct description" do
165
+ Sample.collection(:sample).operation(:index).description.must_equal 'TestIndex'
166
+ end
167
+
168
+ it "should have :id param defined" do
169
+ Sample.collection(:sample).operation(:index).param(:id).must_be_kind_of Sinatra::Rabbit::Param
170
+ Sample.collection(:sample).operation(:index).param(:id).name.must_equal :id
171
+ end
172
+
173
+ it "should not return non-existing param" do
174
+ Sample.collection(:sample).operation(:index).param(:non_existing).must_be_nil
175
+ end
176
+
177
+ it "should allow to add new param" do
178
+ Sample.collection(:sample).operation(:index).param(:next_id, :string)
179
+ Sample.collection(:sample).operation(:index).param(:next_id).must_be_kind_of Sinatra::Rabbit::Param
180
+ end
181
+
182
+ it "should return all params" do
183
+ Sample.collection(:sample).operation(:index).params.wont_be_empty
184
+ end
185
+
186
+ it "should have control block" do
187
+ Sample.collection(:sample).operation(:index).respond_to?(:control).must_equal true
188
+ end
189
+
190
+ it "should have correct path for index operation" do
191
+ Sample.collection(:sample).operation(:index).full_path.must_equal '/sample'
192
+ end
193
+
194
+ it "should have correct path for create operation" do
195
+ Sample.collection(:sample).operation(:create).full_path.must_equal '/sample'
196
+ end
197
+
198
+ it "should have correct path for show operation" do
199
+ Sample.collection(:sample).operation(:show).full_path.must_equal '/sample/:id'
200
+ end
201
+
202
+ it "should have correct path for destroy operation" do
203
+ Sample.collection(:sample).operation(:show).full_path.must_equal '/sample/:id'
204
+ end
205
+
206
+ it "should have correct path for stop operation" do
207
+ Sample.collection(:sample).operation(:stop).full_path.must_equal '/sample/:id/stop'
208
+ end
209
+
210
+ end
211
+
212
+ describe Sinatra::Rabbit::Features do
213
+
214
+ it "should allow to be defined for Sample collection" do
215
+ Sample.features.wont_be_empty
216
+ Sample.features.size.must_equal 3
217
+ end
218
+
219
+ it "should allow to be retrieved by name" do
220
+ Sample.feature(:user_data).wont_be_nil
221
+ Sample.feature(:user_data).name.must_equal :user_data
222
+ end
223
+
224
+ it "should allow to be defined more times" do
225
+ Sample.feature(:user_name).wont_be_nil
226
+ Sample.feature(:user_data).wont_be_nil
227
+ Sample.feature(:non_existing_one).must_be_nil
228
+ end
229
+
230
+ it "should contain reference to collection" do
231
+ Sample.feature(:user_data).collection.wont_be_nil
232
+ Sample.feature(:user_data).collection.must_equal :sample
233
+ end
234
+
235
+ it "should contain array of operations" do
236
+ Sample.feature(:user_data).operations.wont_be_empty
237
+ Sample.feature(:user_data).operations.map {|o| o.class }.must_include Sinatra::Rabbit::Feature::Operation
238
+ end
239
+
240
+ it "should allow to return single operation by name" do
241
+ Sample.feature(:user_data).operation(:index).wont_be_nil
242
+ Sample.feature(:user_data).operation(:non_existing_one).must_be_nil
243
+ Sample.feature(:user_data).operation(:index).name.must_equal :index
244
+ end
245
+
246
+ it "should be retrieved from collection" do
247
+ Sample.collection(:sample).features.wont_be_nil
248
+ Sample.collection(:sample).features.size.must_equal 2
249
+ Sample.collection(:second_sample).features.size.must_equal 1
250
+ end
251
+
252
+ it "should add additionals parameters to given operations" do
253
+ Sample.collection(:sample).operation(:index).params.map { |p| p.name }.must_include :feature_name
254
+ Sample.collection(:sample).operation(:index).params.map { |p| p.name }.must_include :feature_data
255
+ Sample.collection(:second_sample).operation(:index).params.map { |p| p.name }.must_include :feature_second
256
+ end
257
+
258
+ it "should not add additional parameters to other operations" do
259
+ Sample.collection(:sample).operation(:show).params.map { |p| p.name }.wont_include :feature_name
260
+ end
261
+
262
+ end
data/tests/fixtures.rb ADDED
@@ -0,0 +1,149 @@
1
+ require 'rubygems'
2
+ begin
3
+ require 'simplecov'
4
+ if ENV['COVERAGE']
5
+ SimpleCov.start
6
+ SimpleCov.command_name 'Minitest Tests'
7
+ end
8
+ rescue LoadError
9
+ end
10
+
11
+ require 'minitest/autorun'
12
+
13
+ require 'sinatra/base'
14
+ $:.unshift File.join(File::dirname(__FILE__), '..')
15
+ require 'lib/sinatra/rabbit'
16
+
17
+ class Sample < Sinatra::Base
18
+ include Sinatra::Rabbit
19
+ include Sinatra::Rabbit::Features
20
+
21
+ get '/' do
22
+ halt 200
23
+ end
24
+
25
+ features do
26
+ feature :user_data, :for => :sample do
27
+ operation :index do
28
+ param :feature_data, :string
29
+ end
30
+ end
31
+ feature :user_name, :for => :sample do
32
+ operation :index do
33
+ param :feature_name, :string
34
+ end
35
+ end
36
+ feature :profile_sample, :for => :second_sample do
37
+ operation :index do
38
+ param :feature_second, :string
39
+ end
40
+ end
41
+ end
42
+
43
+ collection :sample do
44
+
45
+ collection :subsample, :with_id => :sub_id do
46
+
47
+ collection :secondsubsample do
48
+ description "SecondSubCollection"
49
+ operation :index do
50
+ control do
51
+ status 200
52
+ end
53
+ end
54
+
55
+ end
56
+
57
+ description "Subcollection"
58
+
59
+ operation :start do
60
+ param :id, :required
61
+ control do
62
+ status 200
63
+ end
64
+ end
65
+ operation :show do
66
+ control do
67
+ params[:id]
68
+ end
69
+ end
70
+ end
71
+
72
+ description "Test"
73
+
74
+ operation :index do
75
+ description "TestIndex"
76
+ param :id, :string, :required, "TestParam"
77
+ control do
78
+ status 200
79
+ end
80
+ end
81
+
82
+ operation :rindex do
83
+ description "TestIndex"
84
+ param :r_string, :string, :required, "TestParam"
85
+ param :o_string, :string, :optional, "TestParam"
86
+ param :r_number, :number, :required, "TestParam"
87
+ param :o_number, :number, :optional, "TestParam"
88
+ param :free_param, :string
89
+ param :enum_param, :enum, [1,2,3]
90
+ param :r_enum_param, :enum, :required, [1,2,3]
91
+ control {}
92
+ end
93
+
94
+ operation :show do
95
+ description "TestIndex"
96
+ control do
97
+ [200, {}, params[:id]]
98
+ end
99
+ end
100
+
101
+ operation :create do
102
+ description "TestIndex"
103
+ param :id, :string, :required, "TestParam"
104
+ param :arch, :enum, [1, 2]
105
+ control do
106
+ status 200
107
+ end
108
+ end
109
+
110
+ operation :destroy do
111
+ description "TestIndex"
112
+ control do
113
+ status 201
114
+ end
115
+ end
116
+
117
+ operation :stop, :if => (1==1) do
118
+ description "TestIndex"
119
+ param :id, :string, :required, "TestParam"
120
+ control do
121
+ status 200
122
+ end
123
+ end
124
+
125
+ end
126
+
127
+ collection :second_sample do
128
+ description "SecondTest"
129
+
130
+ action :restart do
131
+ description "Action operation"
132
+ param :id, :string, :required, "Test"
133
+ control do
134
+ status 200
135
+ end
136
+ end
137
+
138
+ operation :index do
139
+ description "SecondTestIndex"
140
+ param :second_id, :string, :required, "TestSecondParam"
141
+ control do
142
+ status 200
143
+ end
144
+ end
145
+ end
146
+
147
+ end
148
+
149
+
@@ -0,0 +1,98 @@
1
+ load File.join(File.dirname(__FILE__), 'fixtures.rb')
2
+
3
+ describe Sinatra::Rabbit::Param do
4
+
5
+ def index_operation
6
+ Sample.collection(:sample).operation(:rindex)
7
+ end
8
+
9
+ it "should return string representation of param" do
10
+ "#{index_operation.param(:r_string)}".must_equal 'r_string:string:required'
11
+ end
12
+
13
+ it "should allow define required string param with description" do
14
+ index_operation.param(:r_string).wont_be_nil
15
+ index_operation.param(:r_string).description.must_equal 'TestParam'
16
+ index_operation.param(:r_string).klass.must_equal :string
17
+ index_operation.param(:r_string).values
18
+ index_operation.param(:r_string).required?.must_equal true
19
+ index_operation.param(:r_string).string?.must_equal true
20
+ index_operation.param(:r_string).optional?.must_equal false
21
+ index_operation.param(:r_string).enum?.must_equal false
22
+ index_operation.param(:r_string).number?.must_equal false
23
+ end
24
+
25
+ it "should allow define optional string param with description" do
26
+ index_operation.param(:o_string).wont_be_nil
27
+ index_operation.param(:o_string).description.must_equal 'TestParam'
28
+ index_operation.param(:o_string).klass.must_equal :string
29
+ index_operation.param(:o_string).values
30
+ index_operation.param(:o_string).required?.must_equal false
31
+ index_operation.param(:o_string).string?.must_equal true
32
+ index_operation.param(:o_string).optional?.must_equal true
33
+ index_operation.param(:o_string).enum?.must_equal false
34
+ index_operation.param(:o_string).number?.must_equal false
35
+ end
36
+
37
+ it "should allow define required number param with description" do
38
+ index_operation.param(:r_number).wont_be_nil
39
+ index_operation.param(:r_number).description.must_equal 'TestParam'
40
+ index_operation.param(:r_number).klass.must_equal :number
41
+ index_operation.param(:r_number).values
42
+ index_operation.param(:r_number).required?.must_equal true
43
+ index_operation.param(:r_number).string?.must_equal false
44
+ index_operation.param(:r_number).optional?.must_equal false
45
+ index_operation.param(:r_number).enum?.must_equal false
46
+ index_operation.param(:r_number).number?.must_equal true
47
+ end
48
+
49
+ it "should allow define optional number param with description" do
50
+ index_operation.param(:o_number).wont_be_nil
51
+ index_operation.param(:o_number).description.must_equal 'TestParam'
52
+ index_operation.param(:o_number).klass.must_equal :number
53
+ index_operation.param(:o_number).required?.must_equal false
54
+ index_operation.param(:o_number).string?.must_equal false
55
+ index_operation.param(:o_number).optional?.must_equal true
56
+ index_operation.param(:o_number).enum?.must_equal false
57
+ index_operation.param(:o_number).number?.must_equal true
58
+ end
59
+
60
+ it "should allow define param just by name and type" do
61
+ index_operation.param(:free_param).wont_be_nil
62
+ index_operation.param(:free_param).description.must_equal 'Description not available'
63
+ index_operation.param(:free_param).klass.must_equal :string
64
+ index_operation.param(:free_param).values.must_be_nil
65
+ index_operation.param(:free_param).required?.must_equal false
66
+ index_operation.param(:free_param).string?.must_equal true
67
+ index_operation.param(:free_param).optional?.must_equal true
68
+ index_operation.param(:free_param).enum?.must_equal false
69
+ index_operation.param(:free_param).number?.must_equal false
70
+ end
71
+
72
+ it "should allow to define optional enum param" do
73
+ index_operation.param(:enum_param).wont_be_nil
74
+ index_operation.param(:enum_param).description.must_equal 'Description not available'
75
+ index_operation.param(:enum_param).klass.must_equal :enum
76
+ index_operation.param(:enum_param).values.wont_be_empty
77
+ index_operation.param(:enum_param).values.must_include 2
78
+ index_operation.param(:enum_param).required?.must_equal false
79
+ index_operation.param(:enum_param).string?.must_equal false
80
+ index_operation.param(:enum_param).optional?.must_equal true
81
+ index_operation.param(:enum_param).enum?.must_equal true
82
+ index_operation.param(:enum_param).number?.must_equal false
83
+ end
84
+
85
+ it "should allow to define required enum param" do
86
+ index_operation.param(:r_enum_param).wont_be_nil
87
+ #index_operation.param(:r_enum_param).description.must_equal 'Description not available'
88
+ index_operation.param(:r_enum_param).klass.must_equal :enum
89
+ #index_operation.param(:r_enum_param).values.wont_be_empty
90
+ #index_operation.param(:r_enum_param).values.must_include 2
91
+ index_operation.param(:r_enum_param).required?.must_equal true
92
+ index_operation.param(:r_enum_param).string?.must_equal false
93
+ index_operation.param(:r_enum_param).optional?.must_equal false
94
+ #index_operation.param(:r_enum_param).enum?.must_equal true
95
+ index_operation.param(:r_enum_param).number?.must_equal false
96
+ end
97
+
98
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sinatra-rabbit
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.5
4
+ version: 1.0.6
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-04-16 00:00:00.000000000 Z
12
+ date: 2012-06-04 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: sinatra
16
- requirement: &70246636376260 !ruby/object:Gem::Requirement
16
+ requirement: &70152956767880 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,7 +21,7 @@ dependencies:
21
21
  version: 1.3.0
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *70246636376260
24
+ version_requirements: *70152956767880
25
25
  description: ! " Rabbit is a Sinatra extension which can help you writing\n a
26
26
  simple REST API using easy to undestand DSL.\n"
27
27
  email: dev@deltacloud.apache.org
@@ -37,6 +37,15 @@ files:
37
37
  - lib/sinatra/rabbit/features.rb
38
38
  - lib/sinatra/rabbit/param.rb
39
39
  - lib/sinatra/rabbit/validator.rb
40
+ - lib/sinatra/docs/api.haml
41
+ - lib/sinatra/docs/collection.haml
42
+ - lib/sinatra/docs/operation.haml
43
+ - tests/app_test.rb
44
+ - tests/docs_test.rb
45
+ - tests/dsl_test.rb
46
+ - tests/fixtures.rb
47
+ - tests/params_test.rb
48
+ - Rakefile
40
49
  - LICENSE
41
50
  - README.md
42
51
  - sinatra-rabbit.gemspec