petitest 0.3.0 → 0.3.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +5 -0
- data/README.md +1 -31
- data/Rakefile +5 -3
- data/lib/petitest.rb +0 -1
- data/lib/petitest/test.rb +0 -5
- data/lib/petitest/version.rb +1 -1
- metadata +1 -2
- data/lib/petitest/dsl.rb +0 -27
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 63ae228bba34d572d8d3c291464806317c2684e2
|
4
|
+
data.tar.gz: 1849b218ea94042e537df22b7ec8eaeec678f68b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d8b4f90cbb58fe9f89b5e1ce503fb05b49d8965daebcb37029add269143907318445943abf3cdce92e54bbaa120625cd7b57263a26695757131119f7accada82
|
7
|
+
data.tar.gz: c0fd58820db206827665e315004f33ad924e00829d9291fc54bb391d95b3f1dceac6157518156e3f5969471837b904e8b4906f518085f5d93155f30e938a1e9a
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -90,37 +90,6 @@ assert { foo }
|
|
90
90
|
|
91
91
|
If you need more assertions, use plugins like [patitest-assertions](https://github.com/petitest/petitest-assertions).
|
92
92
|
|
93
|
-
## DSL
|
94
|
-
|
95
|
-
If you want to use `#desc`, `#test` and `#sub_test` DSL, extend `Petitest::DSL` into your test class.
|
96
|
-
|
97
|
-
```ruby
|
98
|
-
class ExampleTest < Petitest::Test
|
99
|
-
extend ::Petitest::DSL
|
100
|
-
|
101
|
-
test "foo" do
|
102
|
-
assert { foo }
|
103
|
-
end
|
104
|
-
|
105
|
-
desc "fuba"
|
106
|
-
def test_fuba
|
107
|
-
assert { fuba }
|
108
|
-
end
|
109
|
-
|
110
|
-
sub_test "bar" do
|
111
|
-
test "baz" do
|
112
|
-
assert { baz }
|
113
|
-
end
|
114
|
-
|
115
|
-
sub_test "boo" do
|
116
|
-
test "boz" do
|
117
|
-
assert { boz }
|
118
|
-
end
|
119
|
-
end
|
120
|
-
end
|
121
|
-
end
|
122
|
-
```
|
123
|
-
|
124
93
|
## Configuration
|
125
94
|
|
126
95
|
### backtrace_filters
|
@@ -197,6 +166,7 @@ These subscribers are provided by default:
|
|
197
166
|
Here are some official plugins for Petitest:
|
198
167
|
|
199
168
|
- https://github.com/petitest/petitest-assertions
|
169
|
+
- https://github.com/petitest/petitest-dsl
|
200
170
|
- https://github.com/petitest/petitest-power_assert
|
201
171
|
- https://github.com/petitest/petitest-tap
|
202
172
|
|
data/Rakefile
CHANGED
data/lib/petitest.rb
CHANGED
@@ -1,7 +1,6 @@
|
|
1
1
|
require "petitest/assertion_failure_error"
|
2
2
|
require "petitest/assertion_skip_error"
|
3
3
|
require "petitest/configuration"
|
4
|
-
require "petitest/dsl"
|
5
4
|
require "petitest/subscriber_concerns/output_concern"
|
6
5
|
require "petitest/subscriber_concerns/time_concern"
|
7
6
|
require "petitest/subscribers/base_subscriber"
|
data/lib/petitest/test.rb
CHANGED
data/lib/petitest/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: petitest
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ryo Nakamura
|
@@ -71,7 +71,6 @@ files:
|
|
71
71
|
- lib/petitest/assertion_skip_error.rb
|
72
72
|
- lib/petitest/autorun.rb
|
73
73
|
- lib/petitest/configuration.rb
|
74
|
-
- lib/petitest/dsl.rb
|
75
74
|
- lib/petitest/subscriber_concerns/output_concern.rb
|
76
75
|
- lib/petitest/subscriber_concerns/time_concern.rb
|
77
76
|
- lib/petitest/subscribers/base_subscriber.rb
|
data/lib/petitest/dsl.rb
DELETED
@@ -1,27 +0,0 @@
|
|
1
|
-
module Petitest
|
2
|
-
module DSL
|
3
|
-
# @param current_description [String]
|
4
|
-
def desc(current_description)
|
5
|
-
self.current_description = current_description
|
6
|
-
end
|
7
|
-
|
8
|
-
# @param description [String]
|
9
|
-
# @param metadata [Hash{Symbol => Object}]
|
10
|
-
def sub_test(description, metadata = {}, &block)
|
11
|
-
child = ::Class.new(self)
|
12
|
-
child.description = description
|
13
|
-
child.metadata = self.metadata.merge(metadata)
|
14
|
-
child.undefine_test_methods
|
15
|
-
child.class_eval(&block)
|
16
|
-
child
|
17
|
-
end
|
18
|
-
|
19
|
-
# @param description [String]
|
20
|
-
# @param metadata [Hash{Symbol => Object}]
|
21
|
-
def test(description, metadata = {}, &block)
|
22
|
-
block ||= -> { skip }
|
23
|
-
desc(description)
|
24
|
-
define_method("test_#{description}", &block)
|
25
|
-
end
|
26
|
-
end
|
27
|
-
end
|