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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f0718af27aa3da16e50c8172fab0145ec41de84435c1f662af9f404ad81d2ed1
4
- data.tar.gz: 861107ab2de4d07fa3b47c5a09ab39648b253567f17557ddb036c1bca1df7fc1
3
+ metadata.gz: 1443bebc805a4e69172dfca1294ad15f8cf79d7285c6496c63002280dddbf79e
4
+ data.tar.gz: 1b6277394636d37045d71dbaa566f820411d21b0fed517e257981278f4ad9f4d
5
5
  SHA512:
6
- metadata.gz: 6b8e1a64faff9721e48a787841bff898c3b2a52fccc70808b4f298b22ecfe2473ae0d43a066c19267cecd8e640e8266ae81aa79a1097e72f070ab0aec2b0bde3
7
- data.tar.gz: 3d3330b9b3087ae3c8d32775a4bfd0b082f1f0f42954bac03a00ab44b54930d999a4b787fcd768ce507dcea708d6f42878cee805165bb7026f28b19ed18dcba6
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 `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`. The signatures
337
- model `Smartest::DSL` as prepended into `Kernel`, matching how
338
- `smartest/autorun` installs the top-level DSL over Ruby's built-in
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
  #
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Smartest
4
- VERSION = "0.6.2.alpha2"
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
@@ -147,5 +143,13 @@ module Smartest
147
143
  end
148
144
 
149
145
  module Kernel
150
- prepend Smartest::DSL
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
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.alpha2
4
+ version: 0.6.2.alpha3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Yusuke Iwaki