easytest 0.6.0 → 0.7.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
- data/CHANGELOG.md +5 -0
- data/lib/easytest/expectation.rb +7 -3
- data/lib/easytest/matcher/empty.rb +13 -0
- data/lib/easytest/matcher/false.rb +0 -4
- data/lib/easytest/matcher/nil.rb +0 -4
- data/lib/easytest/matcher/true.rb +0 -4
- data/lib/easytest/runner.rb +15 -14
- data/lib/easytest/utils.rb +4 -0
- data/lib/easytest/version.rb +1 -1
- data/lib/easytest.rb +1 -0
- data/sig/easytest.rbs +3 -0
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5f45ff0adb716aa609a9fce9fd5eaefab60b8d56e4b2708a26b56d63189c3b78
|
4
|
+
data.tar.gz: 93b56e1770e0cd3a7d233580eddbd72737e56de4c5ebe405f244c6ca300f1ab9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 14fe72a70136f6aeca4f044bee8c4616d6b3ac8ee32f43bb46b1c888dd70823e73574204c32a91dd48b5df73233e217adfc9b19d6a05c2181a4df2974a4cdb1b
|
7
|
+
data.tar.gz: 90bd1e9e0c2e30905e1c2b4875c29fdc93b861da2ae26cd3df8441bdd5b5bb973b27a9830fe9c5597593ca398362ebeb2b26e96dcb65d0f4a93c1ae76a56e7ac
|
data/CHANGELOG.md
CHANGED
data/lib/easytest/expectation.rb
CHANGED
@@ -14,15 +14,15 @@ module Easytest
|
|
14
14
|
end
|
15
15
|
|
16
16
|
def to_be_nil
|
17
|
-
Matcher::Nil.new(actual: actual, negate: negate).match!
|
17
|
+
Matcher::Nil.new(actual: actual, expected: nil, negate: negate).match!
|
18
18
|
end
|
19
19
|
|
20
20
|
def to_be_true
|
21
|
-
Matcher::True.new(actual: actual, negate: negate).match!
|
21
|
+
Matcher::True.new(actual: actual, expected: true, negate: negate).match!
|
22
22
|
end
|
23
23
|
|
24
24
|
def to_be_false
|
25
|
-
Matcher::False.new(actual: actual, negate: negate).match!
|
25
|
+
Matcher::False.new(actual: actual, expected: false, negate: negate).match!
|
26
26
|
end
|
27
27
|
|
28
28
|
def to_be_a(expected)
|
@@ -37,6 +37,10 @@ module Easytest
|
|
37
37
|
Matcher::InstanceOf.new(actual: actual, expected: expected, negate: negate).match!
|
38
38
|
end
|
39
39
|
|
40
|
+
def to_be_empty
|
41
|
+
Matcher::Empty.new(actual: actual, expected: nil, negate: negate).match!
|
42
|
+
end
|
43
|
+
|
40
44
|
def to_include(expected)
|
41
45
|
Matcher::Include.new(actual: actual, expected: expected, negate: negate).match!
|
42
46
|
end
|
data/lib/easytest/matcher/nil.rb
CHANGED
data/lib/easytest/runner.rb
CHANGED
@@ -24,7 +24,6 @@ module Easytest
|
|
24
24
|
|
25
25
|
reports = []
|
26
26
|
|
27
|
-
|
28
27
|
cases_per_file.each do |c|
|
29
28
|
if include_only_case && !c.only?
|
30
29
|
c.skip!
|
@@ -56,19 +55,7 @@ module Easytest
|
|
56
55
|
puts "#{Rainbow(" FAIL ").bright.bg(:red)} #{link}"
|
57
56
|
end
|
58
57
|
|
59
|
-
reports
|
60
|
-
.sort_by do |result, _|
|
61
|
-
case result
|
62
|
-
when :skipped, :todo
|
63
|
-
0
|
64
|
-
else
|
65
|
-
1
|
66
|
-
end
|
67
|
-
end
|
68
|
-
.each do |result, report|
|
69
|
-
puts report.gsub(/^/, " ").gsub(/^\s+$/, "")
|
70
|
-
puts "" if result == :failed
|
71
|
-
end
|
58
|
+
print_reports(reports)
|
72
59
|
end
|
73
60
|
|
74
61
|
if no_tests?
|
@@ -109,6 +96,20 @@ module Easytest
|
|
109
96
|
total_count == 0
|
110
97
|
end
|
111
98
|
|
99
|
+
def print_reports(reports)
|
100
|
+
unexecuted = [:skipped, :todo]
|
101
|
+
indent = " "
|
102
|
+
|
103
|
+
reports.each do |result, report|
|
104
|
+
puts Utils.indent_text(report, indent) if unexecuted.include?(result)
|
105
|
+
end
|
106
|
+
|
107
|
+
reports.each do |result, report|
|
108
|
+
puts Utils.indent_text(report, indent) unless unexecuted.include?(result)
|
109
|
+
puts "" if result == :failed
|
110
|
+
end
|
111
|
+
end
|
112
|
+
|
112
113
|
def elapsed_time
|
113
114
|
Time.now - start_time
|
114
115
|
end
|
data/lib/easytest/utils.rb
CHANGED
data/lib/easytest/version.rb
CHANGED
data/lib/easytest.rb
CHANGED
@@ -16,6 +16,7 @@ require_relative "easytest/matcher/base"
|
|
16
16
|
require_relative "easytest/matcher/be"
|
17
17
|
require_relative "easytest/matcher/be_a"
|
18
18
|
require_relative "easytest/matcher/contain_exactly"
|
19
|
+
require_relative "easytest/matcher/empty"
|
19
20
|
require_relative "easytest/matcher/equal"
|
20
21
|
require_relative "easytest/matcher/false"
|
21
22
|
require_relative "easytest/matcher/include"
|
data/sig/easytest.rbs
CHANGED
@@ -37,6 +37,9 @@ module Easytest
|
|
37
37
|
# Expect to be an instance of the given class (module).
|
38
38
|
def to_be_instance_of: (Module expected) -> void
|
39
39
|
|
40
|
+
# Expect to be empty.
|
41
|
+
def to_be_empty: () -> void
|
42
|
+
|
40
43
|
# Expect to include the given object.
|
41
44
|
def to_include: (untyped expected) -> void
|
42
45
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: easytest
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.7.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Masafumi Koba
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-10-
|
11
|
+
date: 2022-10-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rainbow
|
@@ -46,6 +46,7 @@ files:
|
|
46
46
|
- lib/easytest/matcher/be.rb
|
47
47
|
- lib/easytest/matcher/be_a.rb
|
48
48
|
- lib/easytest/matcher/contain_exactly.rb
|
49
|
+
- lib/easytest/matcher/empty.rb
|
49
50
|
- lib/easytest/matcher/equal.rb
|
50
51
|
- lib/easytest/matcher/false.rb
|
51
52
|
- lib/easytest/matcher/include.rb
|