smartest 0.6.2.alpha2 → 0.6.2.alpha3
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/README.md +4 -5
- data/lib/smartest/dsl.rb +0 -34
- data/lib/smartest/version.rb +1 -1
- data/sig/smartest.rbs +9 -5
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 1443bebc805a4e69172dfca1294ad15f8cf79d7285c6496c63002280dddbf79e
|
|
4
|
+
data.tar.gz: 1b6277394636d37045d71dbaa566f820411d21b0fed517e257981278f4ad9f4d
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 9b65c8950634a64d22072ed9ee926a45e1cd5250735f946b7f8a8d554ffad93bca933ca6ea692225c1c9521fffb01aa9163ff175c5391f444ab172cb0bfc5dc9
|
|
7
|
+
data.tar.gz: 5a3d0758ad87ccfb17c54234fb0b21c97b86a33dc87b7e1492660d9b97bb22ad2bf53a8b51890264c0bb0dacb3e0d2dbbeebfbd3817c06ae6e42054386afb4cc
|
data/README.md
CHANGED
|
@@ -331,12 +331,11 @@ end
|
|
|
331
331
|
|
|
332
332
|
This makes fixture usage explicit and avoids relying on positional argument order.
|
|
333
333
|
|
|
334
|
-
Smartest also ships RBS signatures for the public DSL, including
|
|
334
|
+
Smartest also ships RBS signatures for the public DSL, including
|
|
335
335
|
`around_suite`, `around_test`, `fixture`, `suite_fixture`, `on_teardown`,
|
|
336
|
-
`expect`, and hook registration methods such as `use_fixture`. The
|
|
337
|
-
|
|
338
|
-
`
|
|
339
|
-
`Kernel#test` file-test helper.
|
|
336
|
+
`expect`, and hook registration methods such as `use_fixture`. The `test`
|
|
337
|
+
method is intentionally not defined in RBS because it conflicts with Ruby's
|
|
338
|
+
built-in `Kernel#test` file-test helper in some editors.
|
|
340
339
|
|
|
341
340
|
## Skipping and pending tests
|
|
342
341
|
|
data/lib/smartest/dsl.rb
CHANGED
|
@@ -2,23 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
module Smartest
|
|
4
4
|
# Top-level Smartest test definition DSL.
|
|
5
|
-
#
|
|
6
|
-
# Smartest installs this module into Kernel when `smartest/autorun` is
|
|
7
|
-
# required. The module intentionally overrides Ruby's built-in `Kernel#test`
|
|
8
|
-
# file-test helper while Smartest tests are being loaded.
|
|
9
5
|
module DSL
|
|
10
|
-
# Define a named Smartest test.
|
|
11
|
-
#
|
|
12
|
-
# Test fixtures are requested with required keyword block parameters:
|
|
13
|
-
#
|
|
14
|
-
# test("opens the home page") do |page:|
|
|
15
|
-
# page.goto("/")
|
|
16
|
-
# end
|
|
17
|
-
#
|
|
18
|
-
# @param name [String, Symbol] human-readable test name
|
|
19
|
-
# @param metadata [Hash] optional metadata kept with the test case
|
|
20
|
-
# @yield test body; required keyword parameters request fixtures
|
|
21
|
-
# @return [void]
|
|
22
6
|
def test(name, **metadata, &block)
|
|
23
7
|
location = caller_locations(1, 1).first
|
|
24
8
|
|
|
@@ -65,24 +49,6 @@ module Smartest
|
|
|
65
49
|
end
|
|
66
50
|
|
|
67
51
|
module Kernel
|
|
68
|
-
# @!method test(name, **metadata, &block)
|
|
69
|
-
# Define a named Smartest test.
|
|
70
|
-
#
|
|
71
|
-
# Fixture values are requested with required keyword block parameters:
|
|
72
|
-
#
|
|
73
|
-
# test("opens the home page") do |page:|
|
|
74
|
-
# page.goto("/")
|
|
75
|
-
# end
|
|
76
|
-
#
|
|
77
|
-
# Smartest installs this method by prepending `Smartest::DSL` into Kernel,
|
|
78
|
-
# so it overrides Ruby's built-in `Kernel#test` file-test helper while
|
|
79
|
-
# Smartest tests are being loaded.
|
|
80
|
-
#
|
|
81
|
-
# @param name [String, Symbol] human-readable test name
|
|
82
|
-
# @param metadata [Hash] optional metadata kept with the test case
|
|
83
|
-
# @yield test body; required keyword parameters request fixtures
|
|
84
|
-
# @return [void]
|
|
85
|
-
#
|
|
86
52
|
# @!method around_suite(&block)
|
|
87
53
|
# Register a hook that wraps the whole suite.
|
|
88
54
|
#
|
data/lib/smartest/version.rb
CHANGED
data/sig/smartest.rbs
CHANGED
|
@@ -14,10 +14,6 @@ module Smartest
|
|
|
14
14
|
module DSL
|
|
15
15
|
private
|
|
16
16
|
|
|
17
|
-
# Define a named test. Fixture values are requested from the block with
|
|
18
|
-
# required keyword arguments, for example `do |page:|`.
|
|
19
|
-
def test: (String | Symbol, **untyped) { (*untyped, **untyped) -> untyped } -> void
|
|
20
|
-
|
|
21
17
|
# Wrap the whole suite. The block receives a run target and must call
|
|
22
18
|
# `suite.run` exactly once.
|
|
23
19
|
def around_suite: () { (SuiteRun) -> untyped } -> void
|
|
@@ -147,5 +143,13 @@ module Smartest
|
|
|
147
143
|
end
|
|
148
144
|
|
|
149
145
|
module Kernel
|
|
150
|
-
|
|
146
|
+
private
|
|
147
|
+
|
|
148
|
+
# Register a suite hook. The block receives a run target and must call
|
|
149
|
+
# `suite.run` exactly once.
|
|
150
|
+
def around_suite: () { (Smartest::SuiteRun) -> untyped } -> void
|
|
151
|
+
|
|
152
|
+
# Register a test hook for tests declared after this hook in the same file.
|
|
153
|
+
# The block receives a run target and must call `test.run` exactly once.
|
|
154
|
+
def around_test: () { (Smartest::TestRun) -> untyped } -> void
|
|
151
155
|
end
|