fix 0.12.3 → 0.13.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data.tar.gz.sig +0 -0
- data/README.md +8 -4
- data/VERSION.semver +1 -1
- data/checksum/fix-0.12.3.gem.sha512 +1 -0
- data/fix.gemspec +1 -1
- data/lib/fix.rb +2 -2
- data/lib/fix/it.rb +9 -2
- data/lib/fix/on.rb +34 -14
- data/lib/fix/report.rb +4 -4
- data/lib/fix/test.rb +3 -3
- metadata +5 -4
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 672c9474d659aff13db9145addc220cf1850ce2a
|
4
|
+
data.tar.gz: f30d896c427e5c591becce972576b49e803378d6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3ddfc38b1a0f2fa445c09226491b9d01cc864f5385223eb5052c8446cefaa77759ff016622d20f7c1b6932fd24d6e8bc5c9f2dbc39b0b53d86f0c837d82e67f3
|
7
|
+
data.tar.gz: 61b7c2d91a81c0b331e1d5dc6086f62ce6126d19974e14d5f7d151a8fcd9aa741c5f622b5ee6140aeffe1ce6bbccf8e027229429fc21a1433b58cd391e067af4
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data.tar.gz.sig
CHANGED
Binary file
|
data/README.md
CHANGED
@@ -47,18 +47,22 @@ And then execute:
|
|
47
47
|
|
48
48
|
## Philosophy
|
49
49
|
|
50
|
-
###
|
50
|
+
### Simple, stupid
|
51
51
|
|
52
|
-
With
|
52
|
+
With 174 LOC built on top of [Spectus expectation library](https://github.com/fixrb/spectus), facilities such as benchmarking and mocking are not supported. __Fix__ offers however a **consistent** DSL to focus your BDD.
|
53
53
|
|
54
|
-
###
|
54
|
+
### True specifications
|
55
55
|
|
56
56
|
While specs behave like **documents** which can be logic-less, their interpretation should not be questioned regardless of the version of __Fix__, preventing from software erosion. Also, Fix specs are compliant with **[RFC 2119](http://tools.ietf.org/html/rfc2119)**.
|
57
57
|
|
58
|
-
###
|
58
|
+
### Low code complexity
|
59
59
|
|
60
60
|
Monkey-patching, [magic tricks and friends](http://blog.arkency.com/2013/06/are-we-abusing-at-exit/) are not included. Instead, animated by **authentic** and **unmuted** Ruby objects, unambiguous, understandable and structured specs are encouraged.
|
61
61
|
|
62
|
+
### Test in isolation
|
63
|
+
|
64
|
+
Rather than a _random order_ option to help finding bugs somewhere (and sometimes luck), __Fix__ prevents from **side effects** by running each test inside a distinct **sub-process**. As it behaves like a function, no matter how many times you call it, the build status remains the same.
|
65
|
+
|
62
66
|
## Usage
|
63
67
|
|
64
68
|
Given this app:
|
data/VERSION.semver
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.
|
1
|
+
0.13.0
|
@@ -0,0 +1 @@
|
|
1
|
+
966ba13292877a34c883227f8dfe7018f7e2e0f8ac543a1b8e4749540143065ddafed82e283ee5e887c3a84e621d9e362b4ffa6d8aa5621bd3ff69e5305ca250
|
data/fix.gemspec
CHANGED
@@ -15,7 +15,7 @@ Gem::Specification.new do |spec|
|
|
15
15
|
spec.require_paths = ['lib']
|
16
16
|
|
17
17
|
spec.add_dependency 'defi', '~> 1.1.0'
|
18
|
-
spec.add_dependency 'spectus', '~> 2.
|
18
|
+
spec.add_dependency 'spectus', '~> 2.8.0'
|
19
19
|
|
20
20
|
spec.add_development_dependency 'bundler', '~> 1.10'
|
21
21
|
spec.add_development_dependency 'rake', '~> 10.4'
|
data/lib/fix.rb
CHANGED
data/lib/fix/it.rb
CHANGED
@@ -17,7 +17,14 @@ module Fix
|
|
17
17
|
@helpers = helpers
|
18
18
|
end
|
19
19
|
|
20
|
-
#
|
20
|
+
# @!attribute [r] helpers
|
21
|
+
#
|
22
|
+
# @return [Hash] The list of helpers.
|
23
|
+
attr_reader :helpers
|
24
|
+
|
25
|
+
private
|
26
|
+
|
27
|
+
# Override Ruby's method_missing in order to provide `On#let` interface.
|
21
28
|
#
|
22
29
|
# @api private
|
23
30
|
#
|
@@ -25,7 +32,7 @@ module Fix
|
|
25
32
|
#
|
26
33
|
# @raise [NoMethodError] If doesn't respond to the given method.
|
27
34
|
def method_missing(name, *args, &block)
|
28
|
-
|
35
|
+
helpers.key?(name) ? helpers.fetch(name).call : super
|
29
36
|
end
|
30
37
|
end
|
31
38
|
end
|
data/lib/fix/on.rb
CHANGED
@@ -1,6 +1,3 @@
|
|
1
|
-
require_relative 'it'
|
2
|
-
require 'defi'
|
3
|
-
|
4
1
|
module Fix
|
5
2
|
# Wraps the target of challenge.
|
6
3
|
#
|
@@ -9,7 +6,7 @@ module Fix
|
|
9
6
|
class On
|
10
7
|
# Initialize the on class.
|
11
8
|
#
|
12
|
-
# @param front_object [
|
9
|
+
# @param front_object [#object_id] The front object of the test.
|
13
10
|
# @param results [Array] The list of collected results.
|
14
11
|
# @param challenges [Array] The list of challenges to apply.
|
15
12
|
# @param helpers [Hash] The list of helpers.
|
@@ -22,11 +19,31 @@ module Fix
|
|
22
19
|
@configuration = configuration
|
23
20
|
end
|
24
21
|
|
22
|
+
# @!attribute [r] front_object
|
23
|
+
#
|
24
|
+
# @return [#object_id] The front object of the test.
|
25
|
+
attr_reader :front_object
|
26
|
+
|
25
27
|
# @!attribute [r] results
|
26
28
|
#
|
27
|
-
# @return [Array] The results.
|
29
|
+
# @return [Array] The list of collected results.
|
28
30
|
attr_reader :results
|
29
31
|
|
32
|
+
# @!attribute [r] challenges
|
33
|
+
#
|
34
|
+
# @return [Array] The list of challenges to apply.
|
35
|
+
attr_reader :challenges
|
36
|
+
|
37
|
+
# @!attribute [r] helpers
|
38
|
+
#
|
39
|
+
# @return [Hash] The list of helpers.
|
40
|
+
attr_reader :helpers
|
41
|
+
|
42
|
+
# @!attribute [r] configuration
|
43
|
+
#
|
44
|
+
# @return [Hash] Settings.
|
45
|
+
attr_reader :configuration
|
46
|
+
|
30
47
|
# Add it method to the DSL.
|
31
48
|
#
|
32
49
|
# @api public
|
@@ -38,7 +55,7 @@ module Fix
|
|
38
55
|
#
|
39
56
|
# @return [Array] List of results.
|
40
57
|
def it(&spec)
|
41
|
-
i = It.new(
|
58
|
+
i = It.new(front_object, challenges, helpers.dup)
|
42
59
|
|
43
60
|
result = begin
|
44
61
|
i.instance_eval(&spec)
|
@@ -46,8 +63,8 @@ module Fix
|
|
46
63
|
f
|
47
64
|
end
|
48
65
|
|
49
|
-
if
|
50
|
-
print result.to_char(
|
66
|
+
if configuration.fetch(:verbose, true)
|
67
|
+
print result.to_char(configuration.fetch(:color, false))
|
51
68
|
end
|
52
69
|
|
53
70
|
results << result
|
@@ -68,11 +85,11 @@ module Fix
|
|
68
85
|
#
|
69
86
|
# @return [Array] List of results.
|
70
87
|
def on(method_name, *args, &block)
|
71
|
-
o = On.new(
|
88
|
+
o = On.new(front_object,
|
72
89
|
results,
|
73
|
-
(
|
74
|
-
|
75
|
-
|
90
|
+
(challenges + [Defi.send(method_name, *args)]),
|
91
|
+
helpers.dup,
|
92
|
+
configuration)
|
76
93
|
|
77
94
|
o.instance_eval(&block)
|
78
95
|
end
|
@@ -87,9 +104,12 @@ module Fix
|
|
87
104
|
# @param method_name [Symbol] The identifier of a method.
|
88
105
|
# @param block [Proc] A spec to compare against the computed value.
|
89
106
|
#
|
90
|
-
# @return [
|
107
|
+
# @return [#object_id] List of results.
|
91
108
|
def let(method_name, &block)
|
92
|
-
|
109
|
+
helpers.update(method_name => block)
|
93
110
|
end
|
94
111
|
end
|
95
112
|
end
|
113
|
+
|
114
|
+
require_relative 'it'
|
115
|
+
require 'defi'
|
data/lib/fix/report.rb
CHANGED
@@ -20,14 +20,14 @@ module Fix
|
|
20
20
|
#
|
21
21
|
# @return [String] The report in plain text.
|
22
22
|
def to_s
|
23
|
-
maybe_thematic_break
|
23
|
+
[maybe_thematic_break, maybe_alerts, total_time, statistics].join
|
24
24
|
end
|
25
25
|
|
26
26
|
private
|
27
27
|
|
28
28
|
# @private
|
29
29
|
def maybe_thematic_break
|
30
|
-
test.results.any? &&
|
30
|
+
test.results.any? && test.configuration.fetch(:verbose) ? "\n\n" : ''
|
31
31
|
end
|
32
32
|
|
33
33
|
# @private
|
@@ -54,7 +54,7 @@ module Fix
|
|
54
54
|
|
55
55
|
# @private
|
56
56
|
def maybe_results_color(string, result)
|
57
|
-
return string unless
|
57
|
+
return string unless test.configuration.fetch(:color)
|
58
58
|
|
59
59
|
color = send("#{result.to_sym}_color")
|
60
60
|
"\e[#{color}m#{string}\e[0m"
|
@@ -67,7 +67,7 @@ module Fix
|
|
67
67
|
|
68
68
|
# @private
|
69
69
|
def statistics
|
70
|
-
if
|
70
|
+
if test.configuration.fetch(:color)
|
71
71
|
statistics_color(statistics_text, test.statistics)
|
72
72
|
else
|
73
73
|
statistics_text
|
data/lib/fix/test.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fix
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.13.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Cyril Wack
|
@@ -30,7 +30,7 @@ cert_chain:
|
|
30
30
|
dzJvWzQ1+dJU6WQv75E9ddSkaQrK3nhdgQVu+/wgvGSrsMvOGNz+LXaSDxQqZuwX
|
31
31
|
0KNQFuIukfrdk8URwRnHoAnvx4U93iUw
|
32
32
|
-----END CERTIFICATE-----
|
33
|
-
date: 2015-
|
33
|
+
date: 2015-10-10 00:00:00.000000000 Z
|
34
34
|
dependencies:
|
35
35
|
- !ruby/object:Gem::Dependency
|
36
36
|
name: defi
|
@@ -52,14 +52,14 @@ dependencies:
|
|
52
52
|
requirements:
|
53
53
|
- - "~>"
|
54
54
|
- !ruby/object:Gem::Version
|
55
|
-
version: 2.
|
55
|
+
version: 2.8.0
|
56
56
|
type: :runtime
|
57
57
|
prerelease: false
|
58
58
|
version_requirements: !ruby/object:Gem::Requirement
|
59
59
|
requirements:
|
60
60
|
- - "~>"
|
61
61
|
- !ruby/object:Gem::Version
|
62
|
-
version: 2.
|
62
|
+
version: 2.8.0
|
63
63
|
- !ruby/object:Gem::Dependency
|
64
64
|
name: bundler
|
65
65
|
requirement: !ruby/object:Gem::Requirement
|
@@ -158,6 +158,7 @@ files:
|
|
158
158
|
- checksum/fix-0.12.0.gem.sha512
|
159
159
|
- checksum/fix-0.12.1.gem.sha512
|
160
160
|
- checksum/fix-0.12.2.gem.sha512
|
161
|
+
- checksum/fix-0.12.3.gem.sha512
|
161
162
|
- checksum/fix-0.2.0.gem.sha512
|
162
163
|
- checksum/fix-0.3.0.gem.sha512
|
163
164
|
- checksum/fix-0.4.0.gem.sha512
|
metadata.gz.sig
CHANGED
Binary file
|