restspec 0.0.4 → 0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (79) hide show
  1. checksums.yaml +4 -4
  2. data/.yardopts +5 -0
  3. data/CHANGELOG.md +0 -0
  4. data/README.md +11 -7
  5. data/Rakefile +7 -0
  6. data/bin/restspec +1 -1
  7. data/examples/store-api-tests/Gemfile.lock +3 -1
  8. data/examples/store-api-tests/api.md +47 -47
  9. data/examples/store-api-tests/spec/api/product_spec.rb +0 -2
  10. data/examples/store-api-tests/spec/api/restspec/endpoints.rb +6 -5
  11. data/examples/store-api-tests/spec/api/restspec/schemas.rb +2 -1
  12. data/{docs → guides}/endpoints.md +0 -0
  13. data/{docs → guides}/helpers.md +0 -0
  14. data/{docs → guides}/macros.md +0 -0
  15. data/{docs → guides}/matchers.md +0 -0
  16. data/{docs → guides}/schemas.md +0 -0
  17. data/{docs → guides}/tutorial.md +1 -1
  18. data/{docs → guides}/types.md +0 -0
  19. data/lib/restspec/configuration.rb +28 -4
  20. data/lib/restspec/endpoints/dsl.rb +281 -48
  21. data/lib/restspec/endpoints/endpoint.rb +18 -58
  22. data/lib/restspec/endpoints/has_schemas.rb +39 -0
  23. data/lib/restspec/endpoints/namespace.rb +4 -7
  24. data/lib/restspec/endpoints/network.rb +27 -0
  25. data/lib/restspec/endpoints/request.rb +3 -0
  26. data/lib/restspec/endpoints/response.rb +3 -0
  27. data/lib/restspec/endpoints/url_builder.rb +51 -0
  28. data/lib/restspec/rspec/api_macros.rb +2 -2
  29. data/lib/restspec/rspec/matchers/be_like_schema.rb +1 -1
  30. data/lib/restspec/rspec/matchers/be_like_schema_array.rb +1 -1
  31. data/lib/restspec/runners/docs/templates/docs.md.erb +2 -2
  32. data/lib/restspec/schema/attribute.rb +43 -0
  33. data/lib/restspec/schema/attribute_example.rb +13 -1
  34. data/lib/restspec/schema/checker.rb +80 -8
  35. data/lib/restspec/schema/dsl.rb +67 -11
  36. data/lib/restspec/schema/schema.rb +13 -1
  37. data/lib/restspec/schema/schema_example.rb +7 -1
  38. data/lib/restspec/schema/types/array_type.rb +42 -1
  39. data/lib/restspec/schema/types/basic_type.rb +62 -0
  40. data/lib/restspec/schema/types/boolean_type.rb +10 -0
  41. data/lib/restspec/schema/types/date_type.rb +12 -0
  42. data/lib/restspec/schema/types/datetime_type.rb +16 -0
  43. data/lib/restspec/schema/types/decimal_string_type.rb +16 -5
  44. data/lib/restspec/schema/types/decimal_type.rb +17 -1
  45. data/lib/restspec/schema/types/embedded_schema_type.rb +39 -8
  46. data/lib/restspec/schema/types/hash_type.rb +51 -12
  47. data/lib/restspec/schema/types/integer_type.rb +12 -1
  48. data/lib/restspec/schema/types/null_type.rb +7 -0
  49. data/lib/restspec/schema/types/one_of_type.rb +18 -0
  50. data/lib/restspec/schema/types/schema_id_type.rb +14 -17
  51. data/lib/restspec/schema/types/string_type.rb +9 -0
  52. data/lib/restspec/schema/types/type_methods.rb +32 -0
  53. data/lib/restspec/schema/types.rb +1 -18
  54. data/lib/restspec/shortcuts.rb +10 -0
  55. data/lib/restspec/stores/endpoint_store.rb +27 -2
  56. data/lib/restspec/stores/namespace_store.rb +23 -4
  57. data/lib/restspec/stores/schema_store.rb +15 -0
  58. data/lib/restspec/values/status_code.rb +16 -1
  59. data/lib/restspec/version.rb +1 -1
  60. data/lib/restspec.rb +2 -0
  61. data/restspec.gemspec +2 -0
  62. data/spec/restspec/endpoints/dsl_spec.rb +32 -19
  63. data/spec/restspec/endpoints/endpoint_spec.rb +20 -43
  64. data/spec/restspec/endpoints/namespace_spec.rb +0 -7
  65. data/spec/restspec/endpoints/request_spec.rb +33 -0
  66. data/spec/restspec/schema/attribute_spec.rb +44 -0
  67. data/spec/restspec/schema/checker_spec.rb +57 -0
  68. data/spec/restspec/schema/dsl_spec.rb +1 -1
  69. data/spec/restspec/schema/schema_spec.rb +15 -0
  70. data/spec/restspec/schema/types/basic_type_spec.rb +2 -2
  71. data/spec/restspec/schema/types/decimal_string_type_spec.rb +56 -0
  72. data/spec/restspec/schema/types/decimal_type_spec.rb +25 -0
  73. data/spec/restspec/schema/types/embedded_schema_type_spec.rb +32 -0
  74. data/spec/restspec/schema/types/hash_type_spec.rb +39 -0
  75. data/spec/restspec/schema/types/integer_type_spec.rb +28 -0
  76. data/spec/restspec/schema/types/one_of_type_spec.rb +21 -0
  77. data/spec/restspec/stores/endpoint_store_spec.rb +62 -0
  78. metadata +63 -10
  79. data/ROADMAP.md +0 -13
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b14366420ef12b0045f219c192a5346c0ff20e67
4
- data.tar.gz: 579f30c0dfb646bbd366cb1a279e663df4894fb8
3
+ metadata.gz: 9b4a864e3d5e797b04cd65a9e2a441314d2a0d7a
4
+ data.tar.gz: ea3719da1f15f76e1491b17052cb6258d137ae79
5
5
  SHA512:
6
- metadata.gz: d73c7968b21b7370351c196ba873554366f08cf15c71c3d85dffea7a49a56a096592fd7c92fb6edb1c0e35869d2f71d461d97b24fde0ae393aa2d42a752a7281
7
- data.tar.gz: 6c12400eae60a5ea62fc2eabf2551f536c0e95dd217adf64556fd414b6b896505f028181984cc08a01a1ae4b064eb1dfe6d26d6c46e8f49da4ade60278a60c94
6
+ metadata.gz: a1407bf290ee76305617826cff5e0cf92185ce82e7e545876bb487c8124700f26bff1a6896028f1b9eeaebdca3d4317931b344955149190aa58809d1693ffe9e
7
+ data.tar.gz: f0bee71a932bbb1e767da9cb95041c59d98a391d652a56ec4a633675efb79d61cb1e72253ad6b7ffc76cf4a0e9460f29a6fe3d5368d7fabb3ac4d6e245e29c6d
data/.yardopts ADDED
@@ -0,0 +1,5 @@
1
+ --protected
2
+ --markup markdown
3
+ --no-private
4
+ --exclude runners/docs/templates/
5
+ --exclude runners/install/templates/
data/CHANGELOG.md ADDED
File without changes
data/README.md CHANGED
@@ -11,7 +11,7 @@ Install it globally like this:
11
11
 
12
12
  ## Usage
13
13
 
14
- For a basic tutorial of how to use Restspec, please check [this file](https://github.com/platanus/restspec/blob/master/docs/tutorial.md).
14
+ For a basic tutorial of how to use Restspec, please check [this file](https://github.com/platanus/restspec/blob/master/guides/tutorial.md).
15
15
 
16
16
  ### The Restspec Approach
17
17
 
@@ -72,7 +72,7 @@ resources :products do
72
72
  end
73
73
  ```
74
74
 
75
- Check the endpoint DSL documentation [here](https://github.com/platanus/restspec/blob/master/docs/endpoints.md) for more details of the available methods and options. The only important thing about them is that they are the endpoints we have to test.
75
+ Check the endpoint DSL documentation [here](https://github.com/platanus/restspec/blob/master/guides/endpoints.md) for more details of the available methods and options. The only important thing about them is that they are the endpoints we have to test.
76
76
 
77
77
  ### Schemas
78
78
 
@@ -92,9 +92,9 @@ schema :category do
92
92
  end
93
93
  ```
94
94
 
95
- As you can see, a schema is compound of attributes that are attached to one type. The types are useful for many things. The types documentation is located [here](https://github.com/platanus/restspec/blob/master/docs/types.md).
95
+ As you can see, a schema is compound of attributes that are attached to one type. The types are useful for many things. The types documentation is located [here](https://github.com/platanus/restspec/blob/master/guides/types.md).
96
96
 
97
- The schemas DSL documentation is located [here](https://github.com/platanus/restspec/blob/master/docs/schemas.md). Schemas are a very important part of Restspec but they are not as necesary as the endpoints.
97
+ The schemas DSL documentation is located [here](https://github.com/platanus/restspec/blob/master/guides/schemas.md). Schemas are a very important part of Restspec but they are not as necesary as the endpoints.
98
98
 
99
99
  ### Tests
100
100
 
@@ -155,7 +155,7 @@ endpoint 'products/update', resource: 'products/show' do
155
155
  end
156
156
  ```
157
157
 
158
- For more information about what can you do in your tests, you can see what are the [available matchers](https://github.com/platanus/restspec/blob/master/docs/matchers.md), the [available helpers](https://github.com/platanus/restspec/blob/master/docs/helpers.md) and the [available macros](https://github.com/platanus/restspec/blob/master/docs/macros.md).
158
+ For more information about what can you do in your tests, you can see what are the [available matchers](https://github.com/platanus/restspec/blob/master/guides/matchers.md), the [available helpers](https://github.com/platanus/restspec/blob/master/guides/helpers.md) and the [available macros](https://github.com/platanus/restspec/blob/master/guides/macros.md).
159
159
 
160
160
  ### Requirements
161
161
 
@@ -180,9 +180,13 @@ endpoint 'products/create' do
180
180
  end
181
181
  ```
182
182
 
183
- ## A note about the Roadmap
183
+ ## If you have some issue
184
184
 
185
- Because the scope of this library is not small, we couldn't make a first release as small as we are acostumed. Anyway, we love to be able to deliver in small iterations, so there a [ROADMAP](https://github.com/platanus/restspec/blob/master/ROADMAP.md) file that we use to keep track of the objectives that we have. Althought many of the objectives of the gem are already done, there are more objectives that will expect to the following releases.
185
+ Be sure to add your issue with a `bug` label or the `question` one.
186
+
187
+ ## A note about SemVer
188
+
189
+ We are using SemVer from 0.0.4 onwards. Versions before 0.0.4 doesn't use Semver and they add some features (intended for MINOR releases, not for PATCH releases). With the addition of 0.0.5, we will be using a CHANGELOG.md file with the track of the commits that made their way to that version.
186
190
 
187
191
  ## Contribute
188
192
 
data/Rakefile CHANGED
@@ -5,13 +5,20 @@ RSpec::Core::RakeTask.new(:spec)
5
5
 
6
6
  task :default => :spec
7
7
 
8
+ desc "generate rdoc"
9
+ task :rdoc do
10
+ sh "bundle exec yardoc"
11
+ end
12
+
8
13
  namespace :restspec do
14
+ desc 'Run the example application defined in examples/store-api'
9
15
  task :run_example_app do
10
16
  Dir.chdir("examples/store-api") do
11
17
  exec("BUNDLE_GEMFILE=Gemfile bundle exec rails s -p 3000")
12
18
  end
13
19
  end
14
20
 
21
+ desc 'Run the example application tests defined in examples/store-api-tests'
15
22
  task :run_example_tests do
16
23
  Dir.chdir("examples/store-api-tests") do
17
24
  exec("BUNDLE_GEMFILE=Gemfile bundle exec rspec spec/")
data/bin/restspec CHANGED
@@ -11,7 +11,7 @@ require 'restspec/runners/docs/docs_runner'
11
11
 
12
12
  class RestspecCLI < Thor
13
13
  register(Restspec::InstallRunner, 'install', 'install [your_test_folder]', 'Type restspec install for more help.')
14
- # register(Restspec::DocsRunner, 'docs', 'docs [your_docs_location]', 'Type restspec docs for more help.')
14
+ register(Restspec::DocsRunner, 'docs', 'docs [your_docs_location]', 'Type restspec docs for more help.')
15
15
  end
16
16
 
17
17
  RestspecCLI.start(ARGV)
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: ~/dev/projects/ruby/restspec
3
3
  specs:
4
- restspec (0.0.3)
4
+ restspec (0.0.4)
5
5
  activesupport (~> 4.0)
6
6
  faker (~> 1.4)
7
7
  hashie (~> 3.3)
@@ -11,6 +11,7 @@ PATH
11
11
  rspec-collection_matchers (~> 1.0)
12
12
  rspec-its (~> 1.0)
13
13
  thor (~> 0.19)
14
+ tilt (~> 2.0)
14
15
 
15
16
  GEM
16
17
  remote: https://rubygems.org/
@@ -59,6 +60,7 @@ GEM
59
60
  slop (3.6.0)
60
61
  thor (0.19.1)
61
62
  thread_safe (0.3.4)
63
+ tilt (2.0.1)
62
64
  tzinfo (1.2.2)
63
65
  thread_safe (~> 0.1)
64
66
 
@@ -10,13 +10,13 @@ Returns schema **product**
10
10
 
11
11
  | Attribute | Type | Example |
12
12
  |-------------|:--------------------------:|---------------:|
13
- | name | string | libero |
14
- | code | string | expedita |
15
- | price | decimal | 49.18 |
16
- | category_id | schema_id | 1 |
17
- | category | embedded_schema | {:name=>"rerum"} |
18
- | created_at | date_time | 2014-12-15T12:37:23-05:00 |
19
- | updated_at | date_time | 2014-12-14T18:01:19-05:00 |
13
+ | created_at | date_time | 2014-12-08T22:35:55-05:00 |
14
+ | updated_at | date_time | 2014-12-02T07:52:23-05:00 |
15
+ | name | string | doloremque |
16
+ | code | string | voluptatem |
17
+ | price | decimal | 61.76 |
18
+ | category_id | schema_id | 51 |
19
+ | category | embedded_schema | {:name=>"deserunt"} |
20
20
 
21
21
  ### Index [GET /products]
22
22
 
@@ -25,13 +25,13 @@ Returns schema **product**
25
25
 
26
26
  | Attribute | Type | Example |
27
27
  |-------------|:--------------------------:|---------------:|
28
- | name | string | voluptatum |
29
- | code | string | blanditiis |
30
- | price | decimal | 77.09 |
31
- | category_id | schema_id | 2 |
32
- | category | embedded_schema | {:name=>"ipsam"} |
33
- | created_at | date_time | 2014-12-11T18:07:45-05:00 |
34
- | updated_at | date_time | 2014-12-20T22:30:23-05:00 |
28
+ | created_at | date_time | 2014-11-27T10:18:05-05:00 |
29
+ | updated_at | date_time | 2014-11-25T14:47:53-05:00 |
30
+ | name | string | quaerat |
31
+ | code | string | et |
32
+ | price | decimal | 70.28 |
33
+ | category_id | schema_id | 51 |
34
+ | category | embedded_schema | {:name=>"rerum"} |
35
35
 
36
36
  ### Show [GET /products/:id]
37
37
 
@@ -40,13 +40,13 @@ Returns schema **product**
40
40
 
41
41
  | Attribute | Type | Example |
42
42
  |-------------|:--------------------------:|---------------:|
43
- | name | string | distinctio |
44
- | code | string | blanditiis |
45
- | price | decimal | 55.84 |
46
- | category_id | schema_id | 4 |
47
- | category | embedded_schema | {:name=>"iure"} |
48
- | created_at | date_time | 2014-12-07T13:39:53-05:00 |
49
- | updated_at | date_time | 2014-12-07T13:45:22-05:00 |
43
+ | created_at | date_time | 2014-12-05T13:39:27-05:00 |
44
+ | updated_at | date_time | 2014-12-23T13:04:47-05:00 |
45
+ | name | string | sed |
46
+ | code | string | quam |
47
+ | price | decimal | 81.56 |
48
+ | category_id | schema_id | 51 |
49
+ | category | embedded_schema | {:name=>"commodi"} |
50
50
 
51
51
  ### Update [PUT /products/:id]
52
52
 
@@ -55,13 +55,13 @@ Returns schema **product**
55
55
 
56
56
  | Attribute | Type | Example |
57
57
  |-------------|:--------------------------:|---------------:|
58
- | name | string | sit |
59
- | code | string | ut |
60
- | price | decimal | 85.80 |
61
- | category_id | schema_id | 5 |
62
- | category | embedded_schema | {:name=>"qui"} |
63
- | created_at | date_time | 2014-12-02T15:11:53-05:00 |
64
- | updated_at | date_time | 2014-11-29T13:55:04-05:00 |
58
+ | created_at | date_time | 2014-12-11T19:55:48-05:00 |
59
+ | updated_at | date_time | 2014-12-01T18:33:17-05:00 |
60
+ | name | string | possimus |
61
+ | code | string | omnis |
62
+ | price | decimal | 13.37 |
63
+ | category_id | schema_id | 51 |
64
+ | category | embedded_schema | {:name=>"tempora"} |
65
65
 
66
66
  ### Destroy [DELETE /products/:id]
67
67
 
@@ -70,13 +70,13 @@ Returns schema **product**
70
70
 
71
71
  | Attribute | Type | Example |
72
72
  |-------------|:--------------------------:|---------------:|
73
- | name | string | aut |
74
- | code | string | illo |
75
- | price | decimal | 81.59 |
76
- | category_id | schema_id | 3 |
77
- | category | embedded_schema | {:name=>"quis"} |
78
- | created_at | date_time | 2014-11-25T07:30:09-05:00 |
79
- | updated_at | date_time | 2014-11-30T22:45:02-05:00 |
73
+ | created_at | date_time | 2014-12-17T17:29:46-05:00 |
74
+ | updated_at | date_time | 2014-12-22T08:20:22-05:00 |
75
+ | name | string | quos |
76
+ | code | string | aut |
77
+ | price | decimal | 32.84 |
78
+ | category_id | schema_id | 51 |
79
+ | category | embedded_schema | {:name=>"saepe"} |
80
80
 
81
81
 
82
82
  ## Categories
@@ -88,7 +88,7 @@ Returns schema **category**
88
88
 
89
89
  | Attribute | Type | Example |
90
90
  |-------------|:--------------------------:|---------------:|
91
- | name | string | voluptate |
91
+ | name | string | nam |
92
92
 
93
93
  ### Index [GET /categories]
94
94
 
@@ -97,7 +97,7 @@ Returns schema **category**
97
97
 
98
98
  | Attribute | Type | Example |
99
99
  |-------------|:--------------------------:|---------------:|
100
- | name | string | odit |
100
+ | name | string | ut |
101
101
 
102
102
  ### Show [GET /categories/:id]
103
103
 
@@ -106,7 +106,7 @@ Returns schema **category**
106
106
 
107
107
  | Attribute | Type | Example |
108
108
  |-------------|:--------------------------:|---------------:|
109
- | name | string | explicabo |
109
+ | name | string | tempore |
110
110
 
111
111
  ### Update [PUT /categories/:id]
112
112
 
@@ -115,7 +115,7 @@ Returns schema **category**
115
115
 
116
116
  | Attribute | Type | Example |
117
117
  |-------------|:--------------------------:|---------------:|
118
- | name | string | quos |
118
+ | name | string | vel |
119
119
 
120
120
  ### Destroy [DELETE /categories/:id]
121
121
 
@@ -124,7 +124,7 @@ Returns schema **category**
124
124
 
125
125
  | Attribute | Type | Example |
126
126
  |-------------|:--------------------------:|---------------:|
127
- | name | string | fuga |
127
+ | name | string | rerum |
128
128
 
129
129
  ### Products [GET /categories/:id/products]
130
130
 
@@ -133,12 +133,12 @@ Returns schema **product**
133
133
 
134
134
  | Attribute | Type | Example |
135
135
  |-------------|:--------------------------:|---------------:|
136
- | name | string | eos |
137
- | code | string | odit |
138
- | price | decimal | 41.37 |
139
- | category_id | schema_id | 8 |
140
- | category | embedded_schema | {:name=>"et"} |
141
- | created_at | date_time | 2014-11-24T12:34:34-05:00 |
142
- | updated_at | date_time | 2014-11-25T02:07:06-05:00 |
136
+ | created_at | date_time | 2014-12-23T23:47:07-05:00 |
137
+ | updated_at | date_time | 2014-11-29T07:40:59-05:00 |
138
+ | name | string | corrupti |
139
+ | code | string | aut |
140
+ | price | decimal | 03.80 |
141
+ | category_id | schema_id | 51 |
142
+ | category | embedded_schema | {:name=>"qui"} |
143
143
 
144
144
 
@@ -3,8 +3,6 @@ require 'spec_helper'
3
3
  RSpec.describe :products, :type => :api do
4
4
  endpoint 'products/create' do
5
5
  test do
6
- payload { schema_example(:product) }
7
-
8
6
  it { should have_status(:created) }
9
7
  end
10
8
  end
@@ -1,10 +1,11 @@
1
1
  resource :products do
2
- schema :product
3
-
4
2
  collection do
5
- post :create
3
+ post :create do
4
+ schema :product, :for => [:payload, :response]
5
+ end
6
+
6
7
  get :index do
7
- schema :product, without: [:category]
8
+ schema :product, :for => [:response], :without => [:category]
8
9
  end
9
10
  end
10
11
 
@@ -13,7 +14,7 @@ resource :products do
13
14
 
14
15
  get :show
15
16
  put :update
16
- delete :destroy
17
+ delete(:destroy) { no_schema }
17
18
  end
18
19
  end
19
20
 
@@ -4,12 +4,13 @@ mixin :timestamps do
4
4
  end
5
5
 
6
6
  schema :product do
7
+ include_attributes :timestamps
8
+
7
9
  attribute :name, string
8
10
  attribute :code, string
9
11
  attribute :price, decimal | decimal_string
10
12
  attribute :category_id, schema_id(:category)
11
13
  attribute :category, embedded_schema(:category), :for => [:checks]
12
- include_attributes :timestamps
13
14
  end
14
15
 
15
16
  schema :category do
File without changes
File without changes
File without changes
File without changes
File without changes
@@ -24,7 +24,7 @@ $ tree
24
24
 
25
25
  ```
26
26
 
27
- If you're familiar with the regular use of RSpec, this initial structure should look normal except from the the files in the `api/restspec` folder.
27
+ If you're familiar with the regular use of RSpec, this initial structure should look normal except for the files in the `api/restspec` folder.
28
28
 
29
29
  - **endpoints.rb**: This is the place to describe your endpoints. One important thing is that your tests **won't define your endpoints**. In this way, we have a graph of the structure of your api *always* and this can help you to visualize your api structure and create better matchers.
30
30
  - **schemas.rb**: The schemas are the shape of the resources you are manipulating in the api. It's a centralized place to put how your data should be.
File without changes
@@ -4,6 +4,30 @@ module Restspec
4
4
  include ActiveSupport::Configurable
5
5
 
6
6
  class << self
7
+ # Configure Restspec and loads the information of the API defined in the DSL definitions if the DSL definitions are defined.
8
+ #
9
+ # The following options are available:
10
+ #
11
+ # - **base_url**: The base url of the API. It is a full url, not only a domain, so it can include more than just the api url but a version path like: `http://localhost:3000/api/v1`.
12
+ # - **schema_definition**: The file location where the file describing the schemas is located.
13
+ # - **endpoints_definition**: The file location where the file describing the endpoints is located.
14
+ # - **requirements_definition**: The file location where the file describing the requirements is located.
15
+ # - **request**: An object that configures the default request. It has a header hash inside to set default headers for every request.
16
+ # - **custom**: An object to hold custom configuration. It can be accessed anywhere using `Restspec.custom`.
17
+ #
18
+ # @yield [config] A block describing the Restspec configuration
19
+ #
20
+ # @example Defines some configuration options:
21
+ # Restspec.configure do |config|
22
+ # config.base_url = 'http://localhost:3000/api/v1'
23
+ #
24
+ # config.schema_definition = "#{File.dirname __FILE__}/schemas.rb"
25
+ # config.endpoints_definition = "#{File.dirname __FILE__}/endpoints.rb"
26
+ # config.requirements_definition = "#{File.dirname __FILE__}/requirements.rb"
27
+ #
28
+ # config.custom.api_key = ENV['API_KEY']
29
+ # config.request.headers['AUTHORIZATION'] = "Token token=\"#{config.custom.api_key}\""
30
+ # end
7
31
  def configure
8
32
  config.request = OpenStruct.new(headers: {})
9
33
  config.request.headers['Content-Type'] = 'application/json'
@@ -16,15 +40,15 @@ module Restspec
16
40
  populate_stores
17
41
  end
18
42
 
43
+ private
44
+
19
45
  def populate_stores
20
- load_schemas
46
+ load_schemas_definition
21
47
  load_endpoint_definition
22
48
  load_requirement_definition
23
49
  end
24
50
 
25
- private
26
-
27
- def load_schemas
51
+ def load_schemas_definition
28
52
  eval_file Schema::DSL.new, config.schema_definition
29
53
  end
30
54