make_it_so 0.3.7 → 0.3.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/generators/rails_app_generator.rb +2 -0
- data/lib/make_it_so/rails/app_builder.rb +16 -2
- data/lib/make_it_so/version.rb +1 -1
- data/spec/features/user_generates_rails_spec.rb +24 -0
- data/templates/rails/.env +2 -0
- data/templates/rails/.env.example +2 -0
- data/templates/rails/spec/javascript/support/jest-fetch-mock.js +1 -0
- metadata +5 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 51d0207bac62321e5b90ec81fbfb797d6ae10e0f
|
4
|
+
data.tar.gz: 9356e6bb0f37c5cb64268e4091c45a75efd20d14
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 37189a870a810b0acd28d3900a6ded2cfc4f61bcc6ea5756bb900ff5dcb0604b18979d3f3fba9d61befc44fb0b785e8a9178bf6c6601d014edd3d59f2dd17a56
|
7
|
+
data.tar.gz: 9ce5bb339871e6604833ab9c155733ee0befbfdb334024535e01b8fcd57468ad1b2b5be17f0431c30c492c72f0ca52b6c71f7ae657d364bf9c1cbf177b00a7f1
|
@@ -99,13 +99,15 @@ module MakeItSo
|
|
99
99
|
'jest',
|
100
100
|
'babel-jest',
|
101
101
|
'enzyme-adapter-react-15.4',
|
102
|
-
'react-addons-test-utils'
|
102
|
+
'react-addons-test-utils',
|
103
|
+
'jest-fetch-mock'
|
103
104
|
]
|
104
105
|
run "yarn add #{deps.join(' ')} --dev"
|
105
106
|
|
106
107
|
run 'mkdir -p spec/javascript/support'
|
107
108
|
inside 'spec/javascript/support' do
|
108
109
|
template 'enzyme.js'
|
110
|
+
template 'jest-fetch-mock.js'
|
109
111
|
end
|
110
112
|
|
111
113
|
modify_json(package_json_file) do |json|
|
@@ -114,6 +116,7 @@ module MakeItSo
|
|
114
116
|
json["scripts"]["test:dev"] = "node_modules/.bin/jest --notify --watch"
|
115
117
|
json["jest"] ||= {}
|
116
118
|
json["jest"].merge!({
|
119
|
+
"automock": false,
|
117
120
|
"roots": [
|
118
121
|
"spec/javascript"
|
119
122
|
],
|
@@ -122,7 +125,8 @@ module MakeItSo
|
|
122
125
|
"app/javascript"
|
123
126
|
],
|
124
127
|
"setupFiles": [
|
125
|
-
"./spec/javascript/support/enzyme.js"
|
128
|
+
"./spec/javascript/support/enzyme.js",
|
129
|
+
"./spec/javascript/support/jest-fetch-mock.js"
|
126
130
|
]
|
127
131
|
})
|
128
132
|
end
|
@@ -143,6 +147,16 @@ module MakeItSo
|
|
143
147
|
end
|
144
148
|
end
|
145
149
|
|
150
|
+
def dotenv
|
151
|
+
self.gem 'dotenv-rails', group: [:development, :test]
|
152
|
+
template '.env'
|
153
|
+
template '.env.example'
|
154
|
+
|
155
|
+
append_to_file '.gitignore' do
|
156
|
+
".env\n"
|
157
|
+
end
|
158
|
+
end
|
159
|
+
|
146
160
|
def rspec_dependency
|
147
161
|
self.gem 'rspec-rails', group: [:development, :test]
|
148
162
|
self.gem 'capybara', group: [:development, :test]
|
data/lib/make_it_so/version.rb
CHANGED
@@ -237,6 +237,23 @@ feature 'user generates rails app' do
|
|
237
237
|
end
|
238
238
|
end
|
239
239
|
|
240
|
+
context 'dotenv' do
|
241
|
+
it 'adds dotenv-rails to Gemfile' do
|
242
|
+
expect(File.read(gemfile_path)).to match(/gem(.*)dotenv-rails/)
|
243
|
+
end
|
244
|
+
|
245
|
+
it 'adds .env to gitignore' do
|
246
|
+
expect(File.read(File.join(app_path, '.gitignore'))).to include(".env\n")
|
247
|
+
end
|
248
|
+
|
249
|
+
it 'creates a .env file' do
|
250
|
+
expect(FileTest.exists?(File.join(app_path, '.env'))).to eq(true)
|
251
|
+
end
|
252
|
+
|
253
|
+
it 'creates a .env.example file' do
|
254
|
+
expect(FileTest.exists?(File.join(app_path, '.env.example'))).to eq(true)
|
255
|
+
end
|
256
|
+
end
|
240
257
|
end
|
241
258
|
|
242
259
|
feature 'jest' do
|
@@ -301,4 +318,11 @@ feature 'jest' do
|
|
301
318
|
expect(json["jest"]["setupFiles"]).to include('./spec/javascript/support/enzyme.js')
|
302
319
|
end
|
303
320
|
end
|
321
|
+
|
322
|
+
scenario 'adds spec/javascript/support/jest-fetch-mock.js to setup' do
|
323
|
+
in_package_json?(package_json_path) do |json|
|
324
|
+
expect(json["jest"]).to_not be_nil
|
325
|
+
expect(json["jest"]["setupFiles"]).to include('./spec/javascript/support/jest-fetch-mock.js')
|
326
|
+
end
|
327
|
+
end
|
304
328
|
end
|
@@ -0,0 +1 @@
|
|
1
|
+
global.fetch = require('jest-fetch-mock')
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: make_it_so
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dan Pickett
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-05-
|
11
|
+
date: 2018-05-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: thor
|
@@ -185,6 +185,8 @@ files:
|
|
185
185
|
- templates/gosu/lib/keys.rb
|
186
186
|
- templates/gosu/readme.md
|
187
187
|
- templates/gosu/spec/spec_helper.rb
|
188
|
+
- templates/rails/.env
|
189
|
+
- templates/rails/.env.example
|
188
190
|
- templates/rails/.gitkeep
|
189
191
|
- templates/rails/app/controllers/application_controller.rb
|
190
192
|
- templates/rails/app/controllers/homes_controller.rb
|
@@ -197,6 +199,7 @@ files:
|
|
197
199
|
- templates/rails/spec/features/user_signs_up_spec.rb
|
198
200
|
- templates/rails/spec/javascript/exampleTest.js
|
199
201
|
- templates/rails/spec/javascript/support/enzyme.js
|
202
|
+
- templates/rails/spec/javascript/support/jest-fetch-mock.js
|
200
203
|
- templates/rails/spec/javascript/testHelper.js
|
201
204
|
- templates/rails/spec/support/database_cleaner.rb
|
202
205
|
- templates/rails/spec/support/devise_controller_spec.rb
|