mackarel 0.4.1 → 0.5.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +6 -6
- data/features.rb +2 -2
- data/lib/mackarel/factories/factory_bot.rb +13 -0
- data/lib/mackarel/factories.rb +1 -1
- data/lib/mackarel/version.rb +1 -1
- data/mackarel.gemspec +3 -3
- metadata +9 -9
- data/lib/mackarel/factories/factory_girl.rb +0 -13
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6cd574d1612f9736edcfdeacef73b7dcaef90614
|
4
|
+
data.tar.gz: efb1b0793773d54779c5e00ae78258c9de90f39e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 74474697cbc8ddc00854086bc213c8370a68cbb62326d11776f5eea3830ea32e4edb02cb7bbd945eed1601517fccdabbea4dcb6d6a9accc598badad1171f37f6
|
7
|
+
data.tar.gz: 6f5cde10df478825ed53edf03db4fc9c503d3573c53e90b054064e03528a9d571e3fbfa791465060d94aed47725936489c1ef9e836a4542deb259bac6c689598
|
data/README.md
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# Mackarel
|
2
2
|
|
3
|
-
Mackarel is a small, hacky extension for acceptance testing in Rails with Capybara and
|
3
|
+
Mackarel is a small, hacky extension for acceptance testing in Rails with Capybara and FactoryBot.
|
4
4
|
|
5
5
|
## Installation
|
6
6
|
|
@@ -24,17 +24,17 @@ In your `spec/spec_helper.rb` or `spec/rails_helper.rb` file add:
|
|
24
24
|
RSpec.configure { |c| config.include Mackarel }
|
25
25
|
```
|
26
26
|
|
27
|
-
If you want to use [
|
27
|
+
If you want to use [FactoryBot](https://github.com/thoughtbot/factory_bot) as the backend for creating assets, add also:
|
28
28
|
|
29
29
|
```ruby
|
30
|
-
Mackarel.config { |c| c.factory =
|
30
|
+
Mackarel.config { |c| c.factory = FactoryBot }
|
31
31
|
```
|
32
32
|
|
33
33
|
## Usage
|
34
34
|
|
35
35
|
Mackarel allows you to write acceptance tests in Rails in a readable way without having to deal with things like Cucumber.
|
36
36
|
|
37
|
-
It uses feature tests with RSpec. It can use
|
37
|
+
It uses feature tests with RSpec. It can use FactoryBot as the factory for models, and Capybara for website testing.
|
38
38
|
|
39
39
|
You can do things like:
|
40
40
|
|
@@ -97,8 +97,8 @@ and_there_exists_an(what, *args, **kwargs, &blk)
|
|
97
97
|
```
|
98
98
|
|
99
99
|
These generate objects. By default, they use `Mackarel::BasicFactory`
|
100
|
-
to do so, but you can change that to use
|
101
|
-
`Mackarel.config.factory = Mackarel::
|
100
|
+
to do so, but you can change that to use FactoryBot with
|
101
|
+
`Mackarel.config.factory = Mackarel::FactoryBot`, or create your own. See later in this README to see how.
|
102
102
|
|
103
103
|
|
104
104
|
Create and friends figure out what you want to call the created
|
data/features.rb
CHANGED
@@ -10,13 +10,13 @@ module FeatureLang
|
|
10
10
|
|
11
11
|
def when_there_exists_a(factory, overrides={})
|
12
12
|
called = overrides.delete(:called) || factory
|
13
|
-
instance_variable_set("@#{called}",
|
13
|
+
instance_variable_set("@#{called}", FactoryBot.create(factory, overrides))
|
14
14
|
end
|
15
15
|
|
16
16
|
def when_there_exist(number, factory, overrides=nil)
|
17
17
|
instance_variable_set("@#{factory}", [])
|
18
18
|
number.times do
|
19
|
-
instance =
|
19
|
+
instance = FactoryBot.create(factory, overrides)
|
20
20
|
instance_variable_get("@#{factory}") << instance
|
21
21
|
end
|
22
22
|
end
|
data/lib/mackarel/factories.rb
CHANGED
@@ -1,2 +1,2 @@
|
|
1
1
|
require "mackarel/factories/basic_factory"
|
2
|
-
require "mackarel/factories/
|
2
|
+
require "mackarel/factories/factory_bot"
|
data/lib/mackarel/version.rb
CHANGED
data/mackarel.gemspec
CHANGED
@@ -10,7 +10,7 @@ Gem::Specification.new do |spec|
|
|
10
10
|
spec.email = ["paolino.gianrossi@gmail.com"]
|
11
11
|
|
12
12
|
spec.summary = %q{Simple feature testing for Rails with Capybara and Rspec}
|
13
|
-
spec.description = %q{Mackarel allows you to write acceptance tests in Rails in a readable way without having to deal with things like Cucumber. It uses feature tests with RSpec,
|
13
|
+
spec.description = %q{Mackarel allows you to write acceptance tests in Rails in a readable way without having to deal with things like Cucumber. It uses feature tests with RSpec, FactoryBot as the factory for models, and generally follows my setup.}
|
14
14
|
spec.homepage = "https://github.com/paologianrossi/mackarel"
|
15
15
|
spec.license = "MIT"
|
16
16
|
|
@@ -33,7 +33,7 @@ Gem::Specification.new do |spec|
|
|
33
33
|
spec.add_dependency "rspec", "~> 3"
|
34
34
|
spec.add_dependency "capybara", "~> 2"
|
35
35
|
spec.add_dependency "poltergeist", "~> 1"
|
36
|
-
spec.add_dependency "
|
37
|
-
spec.add_dependency "activesupport"
|
36
|
+
spec.add_dependency "factory_bot", "~> 4"
|
37
|
+
spec.add_dependency "activesupport", "~> 5"
|
38
38
|
|
39
39
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mackarel
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.5.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Paolo Gianrossi
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-11-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -221,7 +221,7 @@ dependencies:
|
|
221
221
|
- !ruby/object:Gem::Version
|
222
222
|
version: '1'
|
223
223
|
- !ruby/object:Gem::Dependency
|
224
|
-
name:
|
224
|
+
name: factory_bot
|
225
225
|
requirement: !ruby/object:Gem::Requirement
|
226
226
|
requirements:
|
227
227
|
- - "~>"
|
@@ -238,19 +238,19 @@ dependencies:
|
|
238
238
|
name: activesupport
|
239
239
|
requirement: !ruby/object:Gem::Requirement
|
240
240
|
requirements:
|
241
|
-
- - "
|
241
|
+
- - "~>"
|
242
242
|
- !ruby/object:Gem::Version
|
243
|
-
version: '
|
243
|
+
version: '5'
|
244
244
|
type: :runtime
|
245
245
|
prerelease: false
|
246
246
|
version_requirements: !ruby/object:Gem::Requirement
|
247
247
|
requirements:
|
248
|
-
- - "
|
248
|
+
- - "~>"
|
249
249
|
- !ruby/object:Gem::Version
|
250
|
-
version: '
|
250
|
+
version: '5'
|
251
251
|
description: Mackarel allows you to write acceptance tests in Rails in a readable
|
252
252
|
way without having to deal with things like Cucumber. It uses feature tests with
|
253
|
-
RSpec,
|
253
|
+
RSpec, FactoryBot as the factory for models, and generally follows my setup.
|
254
254
|
email:
|
255
255
|
- paolino.gianrossi@gmail.com
|
256
256
|
executables: []
|
@@ -276,7 +276,7 @@ files:
|
|
276
276
|
- lib/mackarel/core.rb
|
277
277
|
- lib/mackarel/factories.rb
|
278
278
|
- lib/mackarel/factories/basic_factory.rb
|
279
|
-
- lib/mackarel/factories/
|
279
|
+
- lib/mackarel/factories/factory_bot.rb
|
280
280
|
- lib/mackarel/version.rb
|
281
281
|
- mackarel.gemspec
|
282
282
|
homepage: https://github.com/paologianrossi/mackarel
|