fix-expect 0.2.0 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data/README.md +9 -9
- data/VERSION.semver +1 -1
- data/fix-expect.gemspec +2 -2
- data/lib/fix/expect.rb +13 -13
- data.tar.gz.sig +0 -0
- metadata +7 -7
- 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: e92ea2ba021747c69003970b73a9cb06fb79bdc8
|
4
|
+
data.tar.gz: aabc739e674a4805046e322074121e6bd966e39c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4616479dc0e99ebb89c9f0e2046e8c367d55219d2f2e6f8a9ec46b0ec5cdbb1db8b0e73c7aeffcbb7bc45b45c4ed600da897c0df3a43cf744593fc6a190d1737
|
7
|
+
data.tar.gz: 85bcc305224153f565cabf1d61cc494b62efaa0152ec8afac5fcbdf28cd3e0c727d5e4aeff61d28d00496f0263d820e98905020118b21f70cdcc37d5ff3b6f3d
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data/README.md
CHANGED
@@ -45,20 +45,20 @@ And then execute:
|
|
45
45
|
__Fix::Expect__ lets you express expected outcomes on an object:
|
46
46
|
|
47
47
|
```ruby
|
48
|
-
expect(value.abs).to
|
48
|
+
expect(value.abs).to equal 42 # => MUST equal 42
|
49
49
|
```
|
50
50
|
|
51
51
|
Both `expect` and `expect_block` methods are mapped to Spectus's [absolute requirement](https://github.com/fixrb/spectus#absolute-requirement)/[prohibition](https://github.com/fixrb/spectus#absolute-prohibition) to express expectations:
|
52
52
|
|
53
53
|
```ruby
|
54
54
|
Fix.describe 6 * 7 do
|
55
|
-
it { expect_block { subject.class }.to
|
56
|
-
it { expect(subject.class).to
|
55
|
+
it { expect_block { subject.class }.to equal Fixnum }
|
56
|
+
it { expect(subject.class).to equal Fixnum }
|
57
57
|
end
|
58
58
|
|
59
59
|
# ..
|
60
60
|
#
|
61
|
-
# Ran 2 tests in 0.
|
61
|
+
# Ran 2 tests in 0.000327 seconds
|
62
62
|
# 100% compliant - 0 infos, 0 failures, 0 errors
|
63
63
|
```
|
64
64
|
|
@@ -68,16 +68,16 @@ Using those methods, the default inherited subject can be overridden by the give
|
|
68
68
|
Fix.describe -6 * 7 do
|
69
69
|
on :abs do
|
70
70
|
# test against the described front object:
|
71
|
-
it { MUST_NOT
|
71
|
+
it { MUST_NOT equal 1 }
|
72
72
|
|
73
73
|
# another test against -1 object:
|
74
|
-
it { expect(-1).to
|
74
|
+
it { expect(-1).to equal 1 }
|
75
75
|
end
|
76
76
|
end
|
77
77
|
|
78
78
|
# ..
|
79
79
|
#
|
80
|
-
# Ran 2 tests in 0.
|
80
|
+
# Ran 2 tests in 0.000372 seconds
|
81
81
|
# 100% compliant - 0 infos, 0 failures, 0 errors
|
82
82
|
```
|
83
83
|
|
@@ -89,13 +89,13 @@ For convenience, the `is_expected` method is also provided:
|
|
89
89
|
Fix.describe -6 * 7 do
|
90
90
|
on :abs do
|
91
91
|
# test against the described front object:
|
92
|
-
it { is_expected.to
|
92
|
+
it { is_expected.to equal 42 }
|
93
93
|
end
|
94
94
|
end
|
95
95
|
|
96
96
|
# .
|
97
97
|
#
|
98
|
-
# Ran 1 tests in 0.
|
98
|
+
# Ran 1 tests in 0.000176 seconds
|
99
99
|
# 100% compliant - 0 infos, 0 failures, 0 errors
|
100
100
|
```
|
101
101
|
|
data/VERSION.semver
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.
|
1
|
+
0.3.0
|
data/fix-expect.gemspec
CHANGED
@@ -14,14 +14,14 @@ Gem::Specification.new do |spec|
|
|
14
14
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
15
15
|
spec.require_paths = ['lib']
|
16
16
|
|
17
|
-
spec.add_dependency 'fix', '~> 0.
|
17
|
+
spec.add_dependency 'fix', '~> 0.16.0'
|
18
18
|
|
19
19
|
spec.add_development_dependency 'bundler', '~> 1.10'
|
20
20
|
spec.add_development_dependency 'rake', '~> 10.4'
|
21
21
|
spec.add_development_dependency 'yard', '~> 0.8'
|
22
22
|
spec.add_development_dependency 'simplecov', '~> 0.10'
|
23
23
|
spec.add_development_dependency 'rubocop', '~> 0.34'
|
24
|
-
spec.add_development_dependency 'spectus', '~>
|
24
|
+
spec.add_development_dependency 'spectus', '~> 3.0'
|
25
25
|
|
26
26
|
spec.cert_chain = ['certs/gem-fixrb-public_cert.pem']
|
27
27
|
private_key = File.expand_path('~/.ssh/gem-fixrb-private_key.pem')
|
data/lib/fix/expect.rb
CHANGED
@@ -17,11 +17,11 @@ module Fix
|
|
17
17
|
|
18
18
|
# Evaluate to a positive assertion.
|
19
19
|
#
|
20
|
-
# @param
|
20
|
+
# @param m [#matches?] The matcher.
|
21
21
|
#
|
22
22
|
# @return (see #requirement)
|
23
|
-
def to(
|
24
|
-
requirement(
|
23
|
+
def to(m)
|
24
|
+
requirement(m, false).result
|
25
25
|
end
|
26
26
|
|
27
27
|
# Evaluate to a negative assertion.
|
@@ -29,8 +29,8 @@ module Fix
|
|
29
29
|
# @param (see #to)
|
30
30
|
#
|
31
31
|
# @return (see #requirement)
|
32
|
-
def not_to(
|
33
|
-
requirement(
|
32
|
+
def not_to(m)
|
33
|
+
requirement(m, true).result
|
34
34
|
end
|
35
35
|
|
36
36
|
# Evaluate to a positive assertion in isolation.
|
@@ -38,8 +38,8 @@ module Fix
|
|
38
38
|
# @param (see #to)
|
39
39
|
#
|
40
40
|
# @return (see #requirement)
|
41
|
-
def to!(
|
42
|
-
requirement(
|
41
|
+
def to!(m)
|
42
|
+
requirement(m, false).result(true)
|
43
43
|
end
|
44
44
|
|
45
45
|
# Evaluate to a negative assertion in isolation.
|
@@ -47,21 +47,21 @@ module Fix
|
|
47
47
|
# @param (see #to)
|
48
48
|
#
|
49
49
|
# @return (see #requirement)
|
50
|
-
def not_to!(
|
51
|
-
requirement(
|
50
|
+
def not_to!(m)
|
51
|
+
requirement(m, true).result(true)
|
52
52
|
end
|
53
53
|
|
54
54
|
private
|
55
55
|
|
56
56
|
# High requirement level.
|
57
57
|
#
|
58
|
-
# @param
|
59
|
-
# @param negate [Boolean]
|
58
|
+
# @param m [#matches?] The matcher.
|
59
|
+
# @param negate [Boolean] Evaluate to a negative assertion.
|
60
60
|
#
|
61
61
|
# @return [Spectus::Result::Fail, Spectus::Result::Pass] Report if the spec
|
62
62
|
# pass or fail.
|
63
|
-
def requirement(
|
64
|
-
Spectus::RequirementLevel::High.new(
|
63
|
+
def requirement(m, negate)
|
64
|
+
Spectus::RequirementLevel::High.new(m, negate, @object, *@challenges)
|
65
65
|
end
|
66
66
|
end
|
67
67
|
end
|
data.tar.gz.sig
CHANGED
Binary file
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fix-expect
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.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-10-
|
33
|
+
date: 2015-10-31 00:00:00.000000000 Z
|
34
34
|
dependencies:
|
35
35
|
- !ruby/object:Gem::Dependency
|
36
36
|
name: fix
|
@@ -38,14 +38,14 @@ dependencies:
|
|
38
38
|
requirements:
|
39
39
|
- - "~>"
|
40
40
|
- !ruby/object:Gem::Version
|
41
|
-
version: 0.
|
41
|
+
version: 0.16.0
|
42
42
|
type: :runtime
|
43
43
|
prerelease: false
|
44
44
|
version_requirements: !ruby/object:Gem::Requirement
|
45
45
|
requirements:
|
46
46
|
- - "~>"
|
47
47
|
- !ruby/object:Gem::Version
|
48
|
-
version: 0.
|
48
|
+
version: 0.16.0
|
49
49
|
- !ruby/object:Gem::Dependency
|
50
50
|
name: bundler
|
51
51
|
requirement: !ruby/object:Gem::Requirement
|
@@ -122,14 +122,14 @@ dependencies:
|
|
122
122
|
requirements:
|
123
123
|
- - "~>"
|
124
124
|
- !ruby/object:Gem::Version
|
125
|
-
version: '
|
125
|
+
version: '3.0'
|
126
126
|
type: :development
|
127
127
|
prerelease: false
|
128
128
|
version_requirements: !ruby/object:Gem::Requirement
|
129
129
|
requirements:
|
130
130
|
- - "~>"
|
131
131
|
- !ruby/object:Gem::Version
|
132
|
-
version: '
|
132
|
+
version: '3.0'
|
133
133
|
description: Fix extension gem to provide the expect syntax.
|
134
134
|
email:
|
135
135
|
- contact@cyril.email
|
@@ -173,7 +173,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
173
173
|
version: '0'
|
174
174
|
requirements: []
|
175
175
|
rubyforge_project:
|
176
|
-
rubygems_version: 2.4.5
|
176
|
+
rubygems_version: 2.4.5
|
177
177
|
signing_key:
|
178
178
|
specification_version: 4
|
179
179
|
summary: Provides the expect syntax.
|
metadata.gz.sig
CHANGED
Binary file
|