cake-tester 0.2.0 → 0.2.1
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 +3 -0
- metadata +2 -16
- data/.gitignore +0 -3
- data/.rubocop.yml +0 -24
- data/.solargraph.yml +0 -22
- data/Gemfile +0 -9
- data/Gemfile.lock +0 -79
- data/Rakefile +0 -10
- data/cake-tester.gemspec +0 -18
- data/test/test_basic.cake.rb +0 -12
- data/test/test_context.cake.rb +0 -102
- data/test/test_expects.cake.rb +0 -48
- data/test/test_failures.cake.rb +0 -46
- data/test/test_group.cake.rb +0 -20
- data/test/test_runner.cake.rb +0 -20
- data/test/test_skip.cake.rb +0 -37
- /data/lib/{cake.rb → cake-tester.rb} +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 01f56911e9316f22cdaa993f76aa003cce5556abf9ecb3110a572d0b07015eaf
|
4
|
+
data.tar.gz: 0d3f3072c6d6f1c34c3c23a414c0bef0dbfd56503655df19617c98d2b0eabef0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b6717f7cb401ee0e65fb58d0725c621e6d9ed703c0532d9c00d2c7328bd3e5d6b9dde9dcf46c75114c4df6023f71ad741de3380d62555492742209a01a805510
|
7
|
+
data.tar.gz: 0f966d766fa06ae3f47e4f97c96b1ca33e89e77698b6a2171655dd4e487947a067cbc0df92808c4db9351c58f5fb87b0acba3d2f7609eef643d0c721732e4e60
|
data/CHANGELOG.md
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cake-tester
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Polyhedra
|
@@ -18,21 +18,14 @@ executables:
|
|
18
18
|
extensions: []
|
19
19
|
extra_rdoc_files: []
|
20
20
|
files:
|
21
|
-
- ".gitignore"
|
22
|
-
- ".rubocop.yml"
|
23
|
-
- ".solargraph.yml"
|
24
21
|
- CHANGELOG.md
|
25
|
-
- Gemfile
|
26
|
-
- Gemfile.lock
|
27
22
|
- LICENSE
|
28
23
|
- README.md
|
29
|
-
- Rakefile
|
30
24
|
- bin/cake
|
31
25
|
- bin/collector.rb
|
32
26
|
- bin/runner.rb
|
33
27
|
- bin/settings.rb
|
34
|
-
- cake-tester.
|
35
|
-
- lib/cake.rb
|
28
|
+
- lib/cake-tester.rb
|
36
29
|
- lib/contextual/child.rb
|
37
30
|
- lib/contextual/context.rb
|
38
31
|
- lib/contextual/group.rb
|
@@ -49,13 +42,6 @@ files:
|
|
49
42
|
- lib/test_options.rb
|
50
43
|
- lib/test_pass.rb
|
51
44
|
- lib/test_result.rb
|
52
|
-
- test/test_basic.cake.rb
|
53
|
-
- test/test_context.cake.rb
|
54
|
-
- test/test_expects.cake.rb
|
55
|
-
- test/test_failures.cake.rb
|
56
|
-
- test/test_group.cake.rb
|
57
|
-
- test/test_runner.cake.rb
|
58
|
-
- test/test_skip.cake.rb
|
59
45
|
homepage: https://github.com/Polyhedra-Studio/Cake-Ruby
|
60
46
|
licenses:
|
61
47
|
- MPL-2.0
|
data/.gitignore
DELETED
data/.rubocop.yml
DELETED
@@ -1,24 +0,0 @@
|
|
1
|
-
AllCops:
|
2
|
-
NewCops: enable
|
3
|
-
|
4
|
-
Layout/ArgumentAlignment:
|
5
|
-
Enabled: false
|
6
|
-
|
7
|
-
Layout/FirstArrayElementIndentation:
|
8
|
-
Enabled: false
|
9
|
-
|
10
|
-
Metrics/AbcSize:
|
11
|
-
Max: 25
|
12
|
-
CountRepeatedAttributes: false
|
13
|
-
|
14
|
-
Metrics/ClassLength:
|
15
|
-
Max: 300
|
16
|
-
|
17
|
-
Metrics/MethodLength:
|
18
|
-
Max: 20
|
19
|
-
|
20
|
-
Metrics/ModuleLength:
|
21
|
-
Max: 300
|
22
|
-
|
23
|
-
Style/Lambda:
|
24
|
-
EnforcedStyle: literal
|
data/.solargraph.yml
DELETED
@@ -1,22 +0,0 @@
|
|
1
|
-
---
|
2
|
-
include:
|
3
|
-
- "**/*.rb"
|
4
|
-
exclude:
|
5
|
-
- spec/**/*
|
6
|
-
- test/**/*
|
7
|
-
- vendor/**/*
|
8
|
-
- ".bundle/**/*"
|
9
|
-
require: []
|
10
|
-
domains: []
|
11
|
-
reporters:
|
12
|
-
- rubocop
|
13
|
-
- require_not_found
|
14
|
-
formatter:
|
15
|
-
rubocop:
|
16
|
-
cops: safe
|
17
|
-
except: []
|
18
|
-
only: []
|
19
|
-
extra_args: []
|
20
|
-
require_paths: []
|
21
|
-
plugins: []
|
22
|
-
max_files: 5000
|
data/Gemfile
DELETED
data/Gemfile.lock
DELETED
@@ -1,79 +0,0 @@
|
|
1
|
-
PATH
|
2
|
-
remote: .
|
3
|
-
specs:
|
4
|
-
cake_tester (0.1.0)
|
5
|
-
|
6
|
-
GEM
|
7
|
-
remote: http://www.rubygems.org/
|
8
|
-
specs:
|
9
|
-
ast (2.4.2)
|
10
|
-
backport (1.2.0)
|
11
|
-
benchmark (0.3.0)
|
12
|
-
diff-lcs (1.5.0)
|
13
|
-
e2mmap (0.1.0)
|
14
|
-
jaro_winkler (1.5.6)
|
15
|
-
json (2.7.1)
|
16
|
-
kramdown (2.4.0)
|
17
|
-
rexml
|
18
|
-
kramdown-parser-gfm (1.1.0)
|
19
|
-
kramdown (~> 2.0)
|
20
|
-
language_server-protocol (3.17.0.3)
|
21
|
-
nokogiri (1.15.5-x86_64-darwin)
|
22
|
-
racc (~> 1.4)
|
23
|
-
parallel (1.23.0)
|
24
|
-
parser (3.2.2.4)
|
25
|
-
ast (~> 2.4.1)
|
26
|
-
racc
|
27
|
-
racc (1.7.3)
|
28
|
-
rainbow (3.1.1)
|
29
|
-
rbs (2.8.4)
|
30
|
-
regexp_parser (2.8.3)
|
31
|
-
reverse_markdown (2.1.1)
|
32
|
-
nokogiri
|
33
|
-
rexml (3.2.6)
|
34
|
-
rubocop (1.58.0)
|
35
|
-
json (~> 2.3)
|
36
|
-
language_server-protocol (>= 3.17.0)
|
37
|
-
parallel (~> 1.10)
|
38
|
-
parser (>= 3.2.2.4)
|
39
|
-
rainbow (>= 2.2.2, < 4.0)
|
40
|
-
regexp_parser (>= 1.8, < 3.0)
|
41
|
-
rexml (>= 3.2.5, < 4.0)
|
42
|
-
rubocop-ast (>= 1.30.0, < 2.0)
|
43
|
-
ruby-progressbar (~> 1.7)
|
44
|
-
unicode-display_width (>= 2.4.0, < 3.0)
|
45
|
-
rubocop-ast (1.30.0)
|
46
|
-
parser (>= 3.2.1.0)
|
47
|
-
ruby-progressbar (1.13.0)
|
48
|
-
solargraph (0.50.0)
|
49
|
-
backport (~> 1.2)
|
50
|
-
benchmark
|
51
|
-
bundler (~> 2.0)
|
52
|
-
diff-lcs (~> 1.4)
|
53
|
-
e2mmap
|
54
|
-
jaro_winkler (~> 1.5)
|
55
|
-
kramdown (~> 2.3)
|
56
|
-
kramdown-parser-gfm (~> 1.1)
|
57
|
-
parser (~> 3.0)
|
58
|
-
rbs (~> 2.0)
|
59
|
-
reverse_markdown (~> 2.0)
|
60
|
-
rubocop (~> 1.38)
|
61
|
-
thor (~> 1.0)
|
62
|
-
tilt (~> 2.0)
|
63
|
-
yard (~> 0.9, >= 0.9.24)
|
64
|
-
thor (1.3.0)
|
65
|
-
tilt (2.3.0)
|
66
|
-
unicode-display_width (2.5.0)
|
67
|
-
yard (0.9.34)
|
68
|
-
|
69
|
-
PLATFORMS
|
70
|
-
x86_64-darwin-23
|
71
|
-
|
72
|
-
DEPENDENCIES
|
73
|
-
cake_tester!
|
74
|
-
rubocop
|
75
|
-
solargraph
|
76
|
-
yard
|
77
|
-
|
78
|
-
BUNDLED WITH
|
79
|
-
2.4.10
|
data/Rakefile
DELETED
data/cake-tester.gemspec
DELETED
@@ -1,18 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
Gem::Specification.new do |gem|
|
4
|
-
gem.name = 'cake-tester'
|
5
|
-
gem.version = '0.2.0'
|
6
|
-
gem.authors = ['Polyhedra', 'C. Lee Spruit']
|
7
|
-
gem.summary = 'The lightweight, explicit testing framework for Ruby.'
|
8
|
-
gem.description = ''
|
9
|
-
gem.homepage = 'https://github.com/Polyhedra-Studio/Cake-Ruby'
|
10
|
-
gem.license = 'MPL-2.0'
|
11
|
-
gem.required_ruby_version = '>= 2.7.0'
|
12
|
-
gem.metadata['rubygems_mfa_required'] = 'true'
|
13
|
-
|
14
|
-
gem.files = `git ls-files -z`.split("\x0")
|
15
|
-
# gem.executables = gem.files.grep(%r{^bin/}).map { |f| File.basename(f) }
|
16
|
-
gem.executables << 'cake'
|
17
|
-
gem.require_paths = ['lib']
|
18
|
-
end
|
data/test/test_basic.cake.rb
DELETED
data/test/test_context.cake.rb
DELETED
@@ -1,102 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require_relative '../lib/cake'
|
4
|
-
|
5
|
-
teardown_counter = 0
|
6
|
-
|
7
|
-
TestRunner.new('Test Runner - Context', [
|
8
|
-
Test.new(
|
9
|
-
'Action should set "actual"',
|
10
|
-
action: ->(_test) { true },
|
11
|
-
assertions: ->(test) { [Expect::IsTrue.new(test.actual)] }
|
12
|
-
),
|
13
|
-
Test.new(
|
14
|
-
'Action can set "actual" and "expected"',
|
15
|
-
action: ->(test) {
|
16
|
-
value = 'foo'
|
17
|
-
test.actual = value
|
18
|
-
test.expected = value
|
19
|
-
},
|
20
|
-
assertions: ->(test) { [Expect::Equals.new(actual: test.actual, expected: test.expected)] }
|
21
|
-
),
|
22
|
-
Test.new(
|
23
|
-
'Other variables can be declared in context',
|
24
|
-
action: ->(test) {
|
25
|
-
test.foo = 'bar'
|
26
|
-
},
|
27
|
-
assertions: ->(test) {
|
28
|
-
[Expect::Equals.new(
|
29
|
-
actual: test.foo,
|
30
|
-
expected: 'bar'
|
31
|
-
)]
|
32
|
-
}
|
33
|
-
),
|
34
|
-
Test.new(
|
35
|
-
'Siblings should not affect each other',
|
36
|
-
assertions: ->(test) {
|
37
|
-
[Expect::IsNil.new(test.foo)]
|
38
|
-
}
|
39
|
-
),
|
40
|
-
Test.new(
|
41
|
-
'Values can be set in setup',
|
42
|
-
setup: ->(test) {
|
43
|
-
test.actual = true
|
44
|
-
test.expected = true
|
45
|
-
test.foo = 'bar'
|
46
|
-
},
|
47
|
-
assertions:
|
48
|
-
->(test) {
|
49
|
-
[
|
50
|
-
Expect::Equals.new(actual: test.foo, expected: 'bar'),
|
51
|
-
Expect::Equals.new(actual: test.actual, expected: test.expected)
|
52
|
-
]
|
53
|
-
}
|
54
|
-
),
|
55
|
-
Test.new(
|
56
|
-
'Values can be modified in teardown',
|
57
|
-
setup: ->(_test) {
|
58
|
-
teardown_counter += 1
|
59
|
-
},
|
60
|
-
assertions: ->(_test) {
|
61
|
-
[
|
62
|
-
Expect::IsTrue.new(teardown_counter.positive?)
|
63
|
-
]
|
64
|
-
},
|
65
|
-
teardown: ->(_test) {
|
66
|
-
teardown_counter = 0
|
67
|
-
}
|
68
|
-
),
|
69
|
-
Test.new(
|
70
|
-
'Teardown reset value',
|
71
|
-
assertions: ->(_test) {
|
72
|
-
[
|
73
|
-
Expect::IsTrue.new(teardown_counter.zero?)
|
74
|
-
]
|
75
|
-
}
|
76
|
-
),
|
77
|
-
Group.new('Groups can assign context', [
|
78
|
-
Test.new(
|
79
|
-
'Group can pass context to children',
|
80
|
-
assertions: ->(test) { [Expect::Equals.new(actual: test.foo, expected: 'bar')] }
|
81
|
-
),
|
82
|
-
Test.new(
|
83
|
-
'Children can override parent context',
|
84
|
-
action: ->(test) { test.foo = 'baz' },
|
85
|
-
assertions: ->(test) { [Expect::Equals.new(actual: test.foo, expected: 'baz')] }
|
86
|
-
)
|
87
|
-
], setup: ->(test) {
|
88
|
-
test.foo = 'bar'
|
89
|
-
}),
|
90
|
-
Group.new('Groups can modify values in teardown after children have run', [
|
91
|
-
Test.new(
|
92
|
-
'Teardown counter should be 1',
|
93
|
-
assertions: proc { [Expect::Equals.new(actual: teardown_counter, expected: 1)] }
|
94
|
-
)
|
95
|
-
],
|
96
|
-
setup: proc { teardown_counter += 1 },
|
97
|
-
teardown: proc { teardown_counter = 0 }),
|
98
|
-
Test.new(
|
99
|
-
'Teardown reset value',
|
100
|
-
assertions: proc { [Expect::Equals.new(actual: teardown_counter, expected: 0)] }
|
101
|
-
)
|
102
|
-
])
|
data/test/test_expects.cake.rb
DELETED
@@ -1,48 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require_relative '../lib/cake'
|
4
|
-
|
5
|
-
TestRunner.new('Simple Test with no groups', [
|
6
|
-
Test.new(
|
7
|
-
'True is true - assertion',
|
8
|
-
assertions: proc {
|
9
|
-
[Expect::IsTrue.new(true)]
|
10
|
-
}
|
11
|
-
),
|
12
|
-
Test.new(
|
13
|
-
'Equals, true is equal to true',
|
14
|
-
assertions: proc {
|
15
|
-
[Expect::Equals.new(actual: true, expected: true)]
|
16
|
-
}
|
17
|
-
),
|
18
|
-
Test.new(
|
19
|
-
'IsNotEqual, true is not equal to false',
|
20
|
-
assertions: proc {
|
21
|
-
[Expect::IsNotEqual.new(actual: true, not_expected: false)]
|
22
|
-
}
|
23
|
-
),
|
24
|
-
Test.new(
|
25
|
-
'IsNil, nil is nil',
|
26
|
-
assertions: proc {
|
27
|
-
[Expect::IsNil.new(nil)]
|
28
|
-
}
|
29
|
-
),
|
30
|
-
Test.new(
|
31
|
-
'IsNotNil, true is not nil',
|
32
|
-
assertions: proc {
|
33
|
-
[Expect::IsNotNil.new(true)]
|
34
|
-
}
|
35
|
-
),
|
36
|
-
Test.new('RespondTo, true responds to is_a?',
|
37
|
-
assertions: proc {
|
38
|
-
[Expect::RespondTo.new(true, :is_a?)]
|
39
|
-
}),
|
40
|
-
Test.new('Undefined, true does not respond to foo',
|
41
|
-
assertions: proc {
|
42
|
-
[Expect::Undefined.new(true, :foo)]
|
43
|
-
}),
|
44
|
-
Test.new('DoesNotRepondTo, is a synonym for Undefined',
|
45
|
-
assertions: proc {
|
46
|
-
[Expect::DoesNotRespondTo.new(true, :foo)]
|
47
|
-
})
|
48
|
-
])
|
data/test/test_failures.cake.rb
DELETED
@@ -1,46 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require_relative '../lib/cake'
|
4
|
-
|
5
|
-
TestRunner.new('All of these should fail in various ways', [
|
6
|
-
Test.new('Should report multiple failures',
|
7
|
-
assertions: proc {
|
8
|
-
[
|
9
|
-
Expect::Equals.new(actual: true, expected: false),
|
10
|
-
# This line is meant to pass
|
11
|
-
Expect::IsTrue.new(true),
|
12
|
-
Expect::IsFalse.new(true),
|
13
|
-
Expect::IsTrue.new(false)
|
14
|
-
]
|
15
|
-
},
|
16
|
-
options: TestOptions.new(fail_on_first_expect: false)),
|
17
|
-
Test.new('Should report only one failure by default',
|
18
|
-
assertions: proc {
|
19
|
-
[
|
20
|
-
Expect::Equals.new(actual: true, expected: false),
|
21
|
-
# This line is meant to pass
|
22
|
-
Expect::IsTrue.new(true),
|
23
|
-
# This is a failure, but shouldn't be run
|
24
|
-
Expect::IsFalse.new(true),
|
25
|
-
# This is also a failure, and shouldn't be run
|
26
|
-
Expect::IsTrue.new(false)
|
27
|
-
]
|
28
|
-
}),
|
29
|
-
Test.new('Should report only one failure if fail_on_first_expect is true',
|
30
|
-
assertions: proc {
|
31
|
-
[
|
32
|
-
Expect::Equals.new(actual: true, expected: false),
|
33
|
-
# This line is meant to pass
|
34
|
-
Expect::IsTrue.new(true),
|
35
|
-
# This is a failure, but shouldn't be run
|
36
|
-
Expect::IsFalse.new(true),
|
37
|
-
# This is also a failure, and shouldn't be run
|
38
|
-
Expect::IsTrue.new(false)
|
39
|
-
]
|
40
|
-
},
|
41
|
-
options: TestOptions.new(fail_on_first_expect: true)),
|
42
|
-
Group.new('Groups should report as failed when at least one test has failed', [
|
43
|
-
Test.new('This test should fail', assertions: proc { [Expect::IsTrue.new(false)] }),
|
44
|
-
Test.new('This test should pass', assertions: proc { [Expect::IsTrue.new(true)] })
|
45
|
-
])
|
46
|
-
])
|
data/test/test_group.cake.rb
DELETED
@@ -1,20 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require_relative '../lib/cake'
|
4
|
-
|
5
|
-
TestRunner.new('Test Groups', [
|
6
|
-
Group.new('Should run all children tests', [
|
7
|
-
Test.new(
|
8
|
-
'True should be true',
|
9
|
-
assertions: proc { [Expect::IsTrue.new(true)] }
|
10
|
-
),
|
11
|
-
Test.new('False should be false',
|
12
|
-
assertions: proc { [Expect::IsFalse.new(false)] })
|
13
|
-
]),
|
14
|
-
Group.new('Nested Group - Parent', [
|
15
|
-
Group.new('Nested Group - Child', [
|
16
|
-
Test.new('Nested test should pass',
|
17
|
-
assertions: proc { [Expect::IsTrue.new(true)] })
|
18
|
-
])
|
19
|
-
])
|
20
|
-
])
|
data/test/test_runner.cake.rb
DELETED
@@ -1,20 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require_relative '../lib/cake'
|
4
|
-
|
5
|
-
TestRunner.new('Test Runner Cake Test', [
|
6
|
-
Group.new('Runs a group', [
|
7
|
-
Test.new(
|
8
|
-
'Test in group runs',
|
9
|
-
assertions: proc { [Expect::IsTrue.new(true)] }
|
10
|
-
)
|
11
|
-
]),
|
12
|
-
Group.new('Runs a nested group, parent', [
|
13
|
-
Group.new('Runs a nested group, child', [
|
14
|
-
Test.new('Test in a nested group runs',
|
15
|
-
assertions: proc { [Expect::IsTrue.new(true)] })
|
16
|
-
])
|
17
|
-
]),
|
18
|
-
Test.new('Individual test runs',
|
19
|
-
assertions: proc { [Expect::IsTrue.new(true)] })
|
20
|
-
])
|
data/test/test_skip.cake.rb
DELETED
@@ -1,37 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require_relative '../lib/cake'
|
4
|
-
|
5
|
-
TestRunner.new('Test Runner can skip', skip: true)
|
6
|
-
TestRunner.new(
|
7
|
-
'Test Runner with children can skip', [
|
8
|
-
Group.new('This group should be skipped', [
|
9
|
-
Test.new('This test should be skipped', assertions: proc {
|
10
|
-
[Expect::IsTrue.new(true)]
|
11
|
-
})
|
12
|
-
]),
|
13
|
-
Test.new('This test should be skipped', assertions: proc {
|
14
|
-
[Expect::IsTrue.new(true)]
|
15
|
-
})
|
16
|
-
],
|
17
|
-
skip: true
|
18
|
-
)
|
19
|
-
|
20
|
-
TestRunner.new('Test Runner - Children marked skipped should skip', [
|
21
|
-
Group.new('Group - Group marked as skip should be skipped', [
|
22
|
-
Test.new('Children of skipped group should also be skipped', assertions: proc {
|
23
|
-
[Expect::IsTrue.new(true)]
|
24
|
-
})
|
25
|
-
], skip: true),
|
26
|
-
Group.new('Group - Siblings not marked as skipped should not be skipped', [
|
27
|
-
Test.new('This test should not be skipped', assertions: proc {
|
28
|
-
[Expect::IsTrue.new(true)]
|
29
|
-
})
|
30
|
-
]),
|
31
|
-
Test.new('Test - Tests marked as skip should be skipped', assertions: proc {
|
32
|
-
[Expect::IsTrue.new(true)]
|
33
|
-
}, skip: true),
|
34
|
-
Test.new('Test - Siblings of skipped test should not be skipped', assertions: proc {
|
35
|
-
[Expect::IsTrue.new(true)]
|
36
|
-
})
|
37
|
-
])
|
File without changes
|