smartest 0.6.2.alpha1 → 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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5eb327b86d510c4cf4e8ebdf31fcd7be3fe1b78c9109528ac99af08c3af1f9e4
4
- data.tar.gz: 7937fde33ac1e62adb5f4bc39b54b938138af915008fcc350742f66420df5848
3
+ metadata.gz: 1443bebc805a4e69172dfca1294ad15f8cf79d7285c6496c63002280dddbf79e
4
+ data.tar.gz: 1b6277394636d37045d71dbaa566f820411d21b0fed517e257981278f4ad9f4d
5
5
  SHA512:
6
- metadata.gz: 8b011cea66dfec275fe790c0ced127819c23a18e70878bb9f4519d0e87b05e47c06b2b7bbc5de771ff3782cbb032409cb57be50ca2a2211fe79150a15a46b224
7
- data.tar.gz: a77eb822acc8bb07f4f3b38a5f09bf3ca573fabb4542bc03b2e49120b110aad749042fe8004e38c733b0f4629f77673c371011382d7ab2d5e0881364c7a48595
6
+ metadata.gz: 9b65c8950634a64d22072ed9ee926a45e1cd5250735f946b7f8a8d554ffad93bca933ca6ea692225c1c9521fffb01aa9163ff175c5391f444ab172cb0bfc5dc9
7
+ data.tar.gz: 5a3d0758ad87ccfb17c54234fb0b21c97b86a33dc87b7e1492660d9b97bb22ad2bf53a8b51890264c0bb0dacb3e0d2dbbeebfbd3817c06ae6e42054386afb4cc
data/README.md CHANGED
@@ -331,9 +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 `test`,
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`.
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.
337
339
 
338
340
  ## Skipping and pending tests
339
341
 
data/lib/smartest/dsl.rb CHANGED
@@ -1,6 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Smartest
4
+ # Top-level Smartest test definition DSL.
4
5
  module DSL
5
6
  def test(name, **metadata, &block)
6
7
  location = caller_locations(1, 1).first
@@ -16,12 +17,27 @@ module Smartest
16
17
  )
17
18
  end
18
19
 
20
+ # Register a hook that wraps the whole suite.
21
+ #
22
+ # The block receives a `Smartest::SuiteRun` object and must call
23
+ # `suite.run` exactly once.
24
+ #
25
+ # @yieldparam suite [Smartest::SuiteRun] suite run target
26
+ # @return [void]
19
27
  def around_suite(&block)
20
28
  raise ArgumentError, "around_suite block is required" unless block
21
29
 
22
30
  Smartest.suite.around_suite_hooks << block
23
31
  end
24
32
 
33
+ # Register a hook that wraps tests declared after this hook in the same file.
34
+ #
35
+ # The block receives a `Smartest::TestRun` object and must call `test.run`
36
+ # exactly once. The hook wraps fixture setup, the test body, and fixture
37
+ # teardown.
38
+ #
39
+ # @yieldparam test [Smartest::TestRun] test run target
40
+ # @return [void]
25
41
  def around_test(&block)
26
42
  raise ArgumentError, "around_test block is required" unless block
27
43
 
@@ -31,3 +47,24 @@ module Smartest
31
47
  private :test, :around_suite, :around_test
32
48
  end
33
49
  end
50
+
51
+ module Kernel
52
+ # @!method around_suite(&block)
53
+ # Register a hook that wraps the whole suite.
54
+ #
55
+ # The block receives a `Smartest::SuiteRun` object and must call
56
+ # `suite.run` exactly once.
57
+ #
58
+ # @yieldparam suite [Smartest::SuiteRun] suite run target
59
+ # @return [void]
60
+ #
61
+ # @!method around_test(&block)
62
+ # Register a hook that wraps tests declared after this hook in the same file.
63
+ #
64
+ # The block receives a `Smartest::TestRun` object and must call `test.run`
65
+ # exactly once. The hook wraps fixture setup, the test body, and fixture
66
+ # teardown.
67
+ #
68
+ # @yieldparam test [Smartest::TestRun] test run target
69
+ # @return [void]
70
+ end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Smartest
4
- VERSION = "0.6.2.alpha1"
4
+ VERSION = "0.6.2.alpha3"
5
5
  end
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
@@ -149,10 +145,6 @@ end
149
145
  module Kernel
150
146
  private
151
147
 
152
- # Define a named Smartest test. Fixture values are requested with keyword
153
- # block parameters, for example `test("opens page") do |page:|`.
154
- def test: (String | Symbol, **untyped) { (*untyped, **untyped) -> untyped } -> void
155
-
156
148
  # Register a suite hook. The block receives a run target and must call
157
149
  # `suite.run` exactly once.
158
150
  def around_suite: () { (Smartest::SuiteRun) -> untyped } -> void
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: smartest
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.2.alpha1
4
+ version: 0.6.2.alpha3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Yusuke Iwaki