fix-expect 0.4.0 → 0.4.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/LICENSE.md +1 -1
- data/README.md +10 -10
- data/lib/fix/expect.rb +1 -1
- data/lib/fix/it.rb +9 -6
- data/lib/spectus/expectation_target.rb +1 -1
- metadata +57 -44
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3081b8fe2799302049cc0677c25a743b24391add73631b336f751e5a0675fd2b
|
4
|
+
data.tar.gz: 472d3e4dc667961af5e02e557bc0294386da95b5e68e6aa16205516cf4b528b6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 798efbbd04cdbc94093ed72639f19b59e525511f8684c6ebcaf685e6ac74da8f942390350821d3924e57b2e44653f923c2f4eca82dbda04b85a409f48c673ac5
|
7
|
+
data.tar.gz: 0f14bd2a8a7960e589299720aa198ed54ec1c6bd35114b876fc4cb86a94abfea865f5a4a1e09baffc020feb70dee239fcb0ca8390942b6d31946680782ebe353
|
data/LICENSE.md
CHANGED
data/README.md
CHANGED
@@ -1,9 +1,9 @@
|
|
1
1
|
# Fix::Expect
|
2
2
|
|
3
|
-
[![Build Status](https://api.travis-ci.org/fixrb/fix-expect.svg?branch=
|
3
|
+
[![Build Status](https://api.travis-ci.org/fixrb/fix-expect.svg?branch=main)][travis]
|
4
4
|
[![Code Climate](https://codeclimate.com/github/fixrb/fix-expect/badges/gpa.svg)][codeclimate]
|
5
5
|
[![Gem Version](https://badge.fury.io/rb/fix-expect.svg)][gem]
|
6
|
-
[![Inline docs](https://inch-ci.org/github/fixrb/fix-expect.svg?branch=
|
6
|
+
[![Inline docs](https://inch-ci.org/github/fixrb/fix-expect.svg?branch=main)][inchpages]
|
7
7
|
[![Documentation](https://img.shields.io/:yard-docs-38c800.svg)][rubydoc]
|
8
8
|
|
9
9
|
> Provides the `expect` syntax.
|
@@ -13,7 +13,7 @@
|
|
13
13
|
Add this line to your application's Gemfile:
|
14
14
|
|
15
15
|
```ruby
|
16
|
-
gem
|
16
|
+
gem "fix-expect"
|
17
17
|
```
|
18
18
|
|
19
19
|
And then execute:
|
@@ -119,11 +119,11 @@ Because they may or may not be desired, each requirement level has 2 versions:
|
|
119
119
|
Example of test without isolation:
|
120
120
|
|
121
121
|
```ruby
|
122
|
-
greeting =
|
122
|
+
greeting = "Hello, world!"
|
123
123
|
|
124
124
|
Fix do
|
125
|
-
it
|
126
|
-
expect { greeting.gsub!(
|
125
|
+
it "tests without isolation" do
|
126
|
+
expect { greeting.gsub!("world", "Alice") }.to equal "Hello, Alice!"
|
127
127
|
end
|
128
128
|
end
|
129
129
|
|
@@ -133,11 +133,11 @@ greeting # => "Hello, Alice!"
|
|
133
133
|
Example of test in isolation:
|
134
134
|
|
135
135
|
```ruby
|
136
|
-
greeting =
|
136
|
+
greeting = "Hello, world!"
|
137
137
|
|
138
138
|
Fix do
|
139
|
-
it
|
140
|
-
expect { greeting.gsub!(
|
139
|
+
it "tests with isolation" do
|
140
|
+
expect { greeting.gsub!("world", "Alice") }.to! equal "Hello, Alice!"
|
141
141
|
end
|
142
142
|
end
|
143
143
|
|
@@ -161,7 +161,7 @@ The gem is available as open source under the terms of the [MIT License](https:/
|
|
161
161
|
<p>
|
162
162
|
This project is sponsored by:<br />
|
163
163
|
<a href="https://sashite.com/"><img
|
164
|
-
src="https://github.com/fixrb/fix-expect/raw/
|
164
|
+
src="https://github.com/fixrb/fix-expect/raw/main/img/sashite.png"
|
165
165
|
alt="Sashite" /></a>
|
166
166
|
</p>
|
167
167
|
|
data/lib/fix/expect.rb
CHANGED
data/lib/fix/it.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require
|
3
|
+
require "fix"
|
4
4
|
|
5
5
|
# Namespace for the Fix framework.
|
6
6
|
#
|
@@ -10,9 +10,12 @@ module Fix
|
|
10
10
|
# Create a new expection target
|
11
11
|
#
|
12
12
|
# @param callable [#call] The object to test.
|
13
|
+
#
|
14
|
+
# rubocop:disable Lint/MissingSuper
|
13
15
|
def initialize(callable)
|
14
16
|
@callable = callable
|
15
17
|
end
|
18
|
+
# rubocop:enable Lint/MissingSuper
|
16
19
|
end
|
17
20
|
|
18
21
|
# Wraps the target of a Fix expectation.
|
@@ -23,24 +26,24 @@ module Fix
|
|
23
26
|
#
|
24
27
|
# @return [Expect] An expect instance.
|
25
28
|
def expect(object = nil, &block)
|
26
|
-
if
|
29
|
+
if block
|
27
30
|
::Fix::Expect.new(block)
|
28
31
|
else
|
29
32
|
::Fix::Expect.new(::Defi.send(:itself).to(object))
|
30
33
|
end
|
31
34
|
end
|
32
35
|
|
33
|
-
# rubocop:disable PredicateName
|
34
|
-
|
35
36
|
# Create a new expection target given the subject.
|
36
37
|
#
|
37
38
|
# @return [Expect] An expect instance.
|
39
|
+
#
|
40
|
+
# rubocop:disable Naming/PredicateName
|
38
41
|
def is_expected
|
39
42
|
::Fix::Expect.new(callable)
|
40
43
|
end
|
41
|
-
# rubocop:enable PredicateName
|
44
|
+
# rubocop:enable Naming/PredicateName
|
42
45
|
end
|
43
46
|
end
|
44
47
|
|
45
48
|
# require_relative 'expect' unless defined?(::Fix::Expect)
|
46
|
-
require_relative
|
49
|
+
require_relative "../spectus/expectation_target"
|
metadata
CHANGED
@@ -1,87 +1,101 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fix-expect
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Cyril Kato
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-05-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: fix
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- -
|
17
|
+
- - '='
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 1.0.0.
|
19
|
+
version: 1.0.0.beta4
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- -
|
24
|
+
- - '='
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: 1.0.0.
|
26
|
+
version: 1.0.0.beta4
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
|
-
name:
|
28
|
+
name: bundler
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- - "
|
31
|
+
- - ">="
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version:
|
34
|
-
type: :
|
33
|
+
version: '0'
|
34
|
+
type: :development
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- - "
|
38
|
+
- - ">="
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version:
|
40
|
+
version: '0'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
|
-
name:
|
42
|
+
name: rake
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
|
-
- - "
|
45
|
+
- - ">="
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version: '
|
47
|
+
version: '0'
|
48
48
|
type: :development
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
|
-
- - "
|
52
|
+
- - ">="
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version: '
|
54
|
+
version: '0'
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
|
-
name:
|
56
|
+
name: rubocop-md
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
|
-
- - "
|
59
|
+
- - ">="
|
60
60
|
- !ruby/object:Gem::Version
|
61
|
-
version: '
|
61
|
+
version: '0'
|
62
62
|
type: :development
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
|
-
- - "
|
66
|
+
- - ">="
|
67
67
|
- !ruby/object:Gem::Version
|
68
|
-
version: '
|
68
|
+
version: '0'
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
|
-
name: rubocop
|
70
|
+
name: rubocop-performance
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
72
72
|
requirements:
|
73
|
-
- - "
|
73
|
+
- - ">="
|
74
74
|
- !ruby/object:Gem::Version
|
75
|
-
version: '0
|
75
|
+
version: '0'
|
76
76
|
type: :development
|
77
77
|
prerelease: false
|
78
78
|
version_requirements: !ruby/object:Gem::Requirement
|
79
79
|
requirements:
|
80
|
-
- - "
|
80
|
+
- - ">="
|
81
81
|
- !ruby/object:Gem::Version
|
82
|
-
version: '0
|
82
|
+
version: '0'
|
83
83
|
- !ruby/object:Gem::Dependency
|
84
|
-
name: rubocop-
|
84
|
+
name: rubocop-rake
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - ">="
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '0'
|
90
|
+
type: :development
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - ">="
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: '0'
|
97
|
+
- !ruby/object:Gem::Dependency
|
98
|
+
name: rubocop-thread_safety
|
85
99
|
requirement: !ruby/object:Gem::Requirement
|
86
100
|
requirements:
|
87
101
|
- - ">="
|
@@ -98,47 +112,46 @@ dependencies:
|
|
98
112
|
name: simplecov
|
99
113
|
requirement: !ruby/object:Gem::Requirement
|
100
114
|
requirements:
|
101
|
-
- - "
|
115
|
+
- - ">="
|
102
116
|
- !ruby/object:Gem::Version
|
103
|
-
version: '0
|
117
|
+
version: '0'
|
104
118
|
type: :development
|
105
119
|
prerelease: false
|
106
120
|
version_requirements: !ruby/object:Gem::Requirement
|
107
121
|
requirements:
|
108
|
-
- - "
|
122
|
+
- - ">="
|
109
123
|
- !ruby/object:Gem::Version
|
110
|
-
version: '0
|
124
|
+
version: '0'
|
111
125
|
- !ruby/object:Gem::Dependency
|
112
126
|
name: spectus
|
113
127
|
requirement: !ruby/object:Gem::Requirement
|
114
128
|
requirements:
|
115
|
-
- - "
|
129
|
+
- - ">="
|
116
130
|
- !ruby/object:Gem::Version
|
117
|
-
version: '
|
131
|
+
version: '0'
|
118
132
|
type: :development
|
119
133
|
prerelease: false
|
120
134
|
version_requirements: !ruby/object:Gem::Requirement
|
121
135
|
requirements:
|
122
|
-
- - "
|
136
|
+
- - ">="
|
123
137
|
- !ruby/object:Gem::Version
|
124
|
-
version: '
|
138
|
+
version: '0'
|
125
139
|
- !ruby/object:Gem::Dependency
|
126
140
|
name: yard
|
127
141
|
requirement: !ruby/object:Gem::Requirement
|
128
142
|
requirements:
|
129
|
-
- - "
|
143
|
+
- - ">="
|
130
144
|
- !ruby/object:Gem::Version
|
131
|
-
version: '0
|
145
|
+
version: '0'
|
132
146
|
type: :development
|
133
147
|
prerelease: false
|
134
148
|
version_requirements: !ruby/object:Gem::Requirement
|
135
149
|
requirements:
|
136
|
-
- - "
|
150
|
+
- - ">="
|
137
151
|
- !ruby/object:Gem::Version
|
138
|
-
version: '0
|
152
|
+
version: '0'
|
139
153
|
description: Fix extension gem to provide the expect syntax.
|
140
|
-
email:
|
141
|
-
- contact@cyril.email
|
154
|
+
email: contact@cyril.email
|
142
155
|
executables: []
|
143
156
|
extensions: []
|
144
157
|
extra_rdoc_files: []
|
@@ -160,14 +173,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
160
173
|
requirements:
|
161
174
|
- - ">="
|
162
175
|
- !ruby/object:Gem::Version
|
163
|
-
version: 2.
|
176
|
+
version: 2.7.0
|
164
177
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
165
178
|
requirements:
|
166
179
|
- - ">="
|
167
180
|
- !ruby/object:Gem::Version
|
168
181
|
version: '0'
|
169
182
|
requirements: []
|
170
|
-
rubygems_version: 3.1.
|
183
|
+
rubygems_version: 3.1.6
|
171
184
|
signing_key:
|
172
185
|
specification_version: 4
|
173
186
|
summary: Provides the expect syntax.
|