generative 0.2.3 → 0.2.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +3 -3
- data/README.md +20 -4
- data/generative.gemspec +3 -3
- data/lib/generative/formatters.rb +2 -1
- data/lib/generative/rake_task.rb +1 -1
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 57a1eb1a5f589c2b3aad9704083766c9cc529815
|
4
|
+
data.tar.gz: a4e6e4aec51577f305c18fa444977b001ea88db1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b094dbd6215c67423b70a2afd3d4d5f55dbad80cc3d4135c8ace6326229aa02ce7af4c03ab16c00b7b32302cd5a2669e0ec34737cbba4645533a026569978850
|
7
|
+
data.tar.gz: 845d6d14b2bd4aa044f3dce2c4d2d5d0b244748455ad86eb0efcfcb629b2bd45e1b48f7214076bcbf4eb049c0e05fdcc4ba32747031de70acff9673a8c1cb5d1
|
data/.travis.yml
CHANGED
data/README.md
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# Generative
|
2
2
|
|
3
|
-
> Generative testing for RSpec
|
3
|
+
> Generative and property-based testing for RSpec
|
4
4
|
> [![Gem Version](https://badge.fury.io/rb/generative.png)](http://badge.fury.io/rb/generative)
|
5
5
|
> [![Build Status](https://travis-ci.org/justincampbell/generative.png?branch=master)](https://travis-ci.org/justincampbell/generative)
|
6
6
|
> [![Code Climate](https://codeclimate.com/github/justincampbell/generative.png)](https://codeclimate.com/github/justincampbell/generative)
|
@@ -22,7 +22,7 @@ end
|
|
22
22
|
|
23
23
|
```
|
24
24
|
--color
|
25
|
-
--format
|
25
|
+
--format Generative::Formatter
|
26
26
|
--require generative
|
27
27
|
```
|
28
28
|
|
@@ -71,6 +71,22 @@ describe String do
|
|
71
71
|
end
|
72
72
|
```
|
73
73
|
|
74
|
+
Alternatively, you can modify existing specs in a minimally intrusive way by just adding two tags to an existing context and using the fact that `data` is just an alias for `let`:
|
75
|
+
```ruby
|
76
|
+
describe String do
|
77
|
+
describe "#reverse", generative: true, order: :generative do
|
78
|
+
let(:string) { rand(12345).to_s }
|
79
|
+
|
80
|
+
it "maintains length" do
|
81
|
+
expect(string.reverse.length).to eq(string.length)
|
82
|
+
end
|
83
|
+
|
84
|
+
it "is not destructive" do
|
85
|
+
expect(string.reverse.reverse).to eq(string)
|
86
|
+
end
|
87
|
+
end
|
88
|
+
end
|
89
|
+
```
|
74
90
|
### Running
|
75
91
|
|
76
92
|
Generative comes with a `generative` command, which simply runs rspec with the
|
@@ -79,7 +95,7 @@ required arguments:
|
|
79
95
|
```
|
80
96
|
$ generative
|
81
97
|
+ GENERATIVE_COUNT=10_000
|
82
|
-
+ rspec --require generative --format Generative --tag generative
|
98
|
+
+ rspec --require generative --format Generative::Formatter --tag generative
|
83
99
|
Run options: include {:generative=>true}
|
84
100
|
|
85
101
|
String
|
@@ -191,7 +207,7 @@ data and maybe even package them up as your own gems. If you
|
|
191
207
|
do, let us know and we'll link to it here.
|
192
208
|
|
193
209
|
|
194
|
-
#### Degenerate
|
210
|
+
#### [Degenerate](https://github.com/niftyn8/degenerate)
|
195
211
|
|
196
212
|
This library has a few generators for some basic primitives... A great start if
|
197
213
|
you're looking to move quickly.
|
data/generative.gemspec
CHANGED
@@ -10,11 +10,11 @@ authors = {
|
|
10
10
|
|
11
11
|
Gem::Specification.new do |gem|
|
12
12
|
gem.name = 'generative'
|
13
|
-
gem.version = '0.2.
|
13
|
+
gem.version = '0.2.4'
|
14
14
|
gem.authors = authors.keys
|
15
15
|
gem.email = authors.values
|
16
|
-
gem.description = "Generative testing for RSpec"
|
17
|
-
gem.summary = "Generative testing for RSpec"
|
16
|
+
gem.description = "Generative and property-based testing for RSpec"
|
17
|
+
gem.summary = "Generative and property-based testing for RSpec"
|
18
18
|
gem.homepage = "https://github.com/justincampbell/generative"
|
19
19
|
gem.license = 'MIT'
|
20
20
|
|
@@ -37,7 +37,8 @@ module Generative
|
|
37
37
|
output.puts if @group_level == 0
|
38
38
|
|
39
39
|
if generative?(example_group)
|
40
|
-
|
40
|
+
group_description = "#{example_group.description} (generative)"
|
41
|
+
output.puts "#{current_indentation}#{detail_color(group_description)}"
|
41
42
|
|
42
43
|
@group_level += 1
|
43
44
|
example_group.examples.each do |example|
|
data/lib/generative/rake_task.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: generative
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Justin Campbell
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date:
|
13
|
+
date: 2016-09-15 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: rspec
|
@@ -40,7 +40,7 @@ dependencies:
|
|
40
40
|
- - ">="
|
41
41
|
- !ruby/object:Gem::Version
|
42
42
|
version: '0'
|
43
|
-
description: Generative testing for RSpec
|
43
|
+
description: Generative and property-based testing for RSpec
|
44
44
|
email:
|
45
45
|
- justin@justincampbell.com
|
46
46
|
- danmcclory@gmail.com
|
@@ -92,10 +92,10 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
92
92
|
version: '0'
|
93
93
|
requirements: []
|
94
94
|
rubyforge_project:
|
95
|
-
rubygems_version: 2.
|
95
|
+
rubygems_version: 2.6.4
|
96
96
|
signing_key:
|
97
97
|
specification_version: 4
|
98
|
-
summary: Generative testing for RSpec
|
98
|
+
summary: Generative and property-based testing for RSpec
|
99
99
|
test_files:
|
100
100
|
- spec/generative/generator_manager_spec.rb
|
101
101
|
- spec/generative/ordering_spec.rb
|