r_spec 1.0.0.beta8 → 1.0.0.beta9

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 654594b32d5ef5c97f68de1a5f3e99cc38364de1703f747d841fccba725b878c
4
- data.tar.gz: 11038ae3f4f56cf40a7e2d99077ce28e7ee239e36d775dcfe8035954df240e07
3
+ metadata.gz: 6599635e0de35bec4d9bae9f58ab1417a364eb2a0bd64db49b523be4d9ab1d16
4
+ data.tar.gz: 658671a666d8173ce075558dc7dc0f5604e2a98f86e0448485c2ad713ec518be
5
5
  SHA512:
6
- metadata.gz: 91f106a5823915d56c59edf1a7da73285fdf05ef38827368cc44c135c2973b03aa4e3fe013a2e423ffd7bfdc2bd3f24ccd208f6f8e11fddeba3e95bfe800d7cb
7
- data.tar.gz: e25a4dc18ba5ffb7aabb0bbe42dc9ef6b88756e4fb825fa895683e181a1ac05a61d153da05deb7c5142473704f2174b0a5a4e75dd612ed0481b2402a0c15a350
6
+ metadata.gz: 45babe5acbed804ce1a61476c39028cdaa46256c343b0b6001b83e0bd5cda35a83770bd06776c7b76d22cb0dd3cbc07be7978d30d99c04cc1585e9cdeb933778
7
+ data.tar.gz: 78f72312fc8c2ad764647a1e6698f4a094bfc3129c0b2911f809502ba9a11d9a0da88ffafc2420c68d55fdaeeb8062258e8ff738013bded1bcf1970f536f192d
data/README.md CHANGED
@@ -47,7 +47,7 @@ Following [RubyGems naming conventions](https://guides.rubygems.org/name-your-ge
47
47
  Add this line to your application's Gemfile:
48
48
 
49
49
  ```ruby
50
- gem "r_spec", ">= 1.0.0.beta8"
50
+ gem "r_spec", ">= 1.0.0.beta9"
51
51
  ```
52
52
 
53
53
  And then execute:
@@ -19,8 +19,7 @@ module RSpec
19
19
  got: false,
20
20
  matcher: :raise_exception,
21
21
  negate: true,
22
- level: :SHOULD,
23
- valid: false
22
+ level: :SHOULD
24
23
  )
25
24
  end
26
25
  end
@@ -1,6 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require "expresenter"
4
+ require "test_tube"
4
5
 
5
6
  require_relative File.join("..", "console")
6
7
 
@@ -50,12 +51,12 @@ module RSpec
50
51
 
51
52
  protected
52
53
 
54
+ # @param passed [Boolean] The high expectation passed or failed.
53
55
  # @param actual [#object_id] The actual value.
54
56
  # @param error [Exception, nil] Any raised exception.
55
57
  # @param got [Boolean, nil] Any returned value.
56
58
  # @param matcher [#matches?] The matcher.
57
59
  # @param negate [Boolean] The assertion is positive or negative.
58
- # @param valid [Boolean] The result of an expectation.
59
60
  #
60
61
  # @return [nil] Write a message to STDOUT.
61
62
  #
@@ -63,14 +64,13 @@ module RSpec
63
64
  # `Kernel.exit(false)` with a failure message written to STDERR.
64
65
  #
65
66
  # @api private
66
- def result(actual:, error:, got:, matcher:, negate:, valid:)
67
- Console.passed_spec ::Expresenter.call(valid).with(
67
+ def result(passed, actual:, error:, got:, matcher:, negate:)
68
+ Console.passed_spec ::Expresenter.call(passed).with(
68
69
  actual: actual,
69
70
  error: error,
70
71
  expected: matcher.expected,
71
72
  got: got,
72
73
  negate: negate,
73
- valid: valid,
74
74
  matcher: matcher.class.to_sym,
75
75
  level: :MUST
76
76
  )
@@ -1,7 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require "spectus/exam"
4
-
5
3
  require_relative "base"
6
4
 
7
5
  module RSpec
@@ -30,20 +28,20 @@ module RSpec
30
28
  # @raise [SystemExit] Terminate execution immediately by calling
31
29
  # `Kernel.exit(false)` with a failure message written to STDERR.
32
30
  def absolute_requirement(matcher:, negate:)
33
- exam = ::Spectus::Exam.new(
34
- callable: @actual,
31
+ experiment = ::TestTube.invoke(
32
+ @actual,
35
33
  isolation: false,
36
- negate: negate,
37
- matcher: matcher
34
+ matcher: matcher,
35
+ negate: negate
38
36
  )
39
37
 
40
38
  result(
41
- actual: exam.actual,
42
- error: exam.exception,
43
- got: exam.got,
39
+ experiment.got.equal?(true),
40
+ actual: experiment.actual,
41
+ error: experiment.error,
42
+ got: experiment.got,
44
43
  matcher: matcher,
45
- negate: negate,
46
- valid: exam.valid?
44
+ negate: negate
47
45
  )
48
46
  end
49
47
  end
@@ -28,15 +28,19 @@ module RSpec
28
28
  # @raise [SystemExit] Terminate execution immediately by calling
29
29
  # `Kernel.exit(false)` with a failure message written to STDERR.
30
30
  def absolute_requirement(matcher:, negate:)
31
- valid = negate ^ matcher.matches? { @actual }
31
+ experiment = ::TestTube.pass(
32
+ @actual,
33
+ matcher: matcher,
34
+ negate: negate
35
+ )
32
36
 
33
37
  result(
34
- actual: @actual,
35
- error: nil,
36
- got: valid,
38
+ experiment.got.equal?(true),
39
+ actual: experiment.actual,
40
+ error: experiment.error,
41
+ got: experiment.got,
37
42
  matcher: matcher,
38
- negate: negate,
39
- valid: valid
43
+ negate: negate
40
44
  )
41
45
  end
42
46
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: r_spec
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0.beta8
4
+ version: 1.0.0.beta9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Cyril Kato
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-06-17 00:00:00.000000000 Z
11
+ date: 2021-06-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: expresenter
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: 1.2.1
19
+ version: 1.3.0
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: 1.2.1
26
+ version: 1.3.0
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: matchi-rspec
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -39,19 +39,19 @@ dependencies:
39
39
  - !ruby/object:Gem::Version
40
40
  version: 1.1.2
41
41
  - !ruby/object:Gem::Dependency
42
- name: spectus
42
+ name: test_tube
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
45
  - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: 3.3.4
47
+ version: 1.0.0
48
48
  type: :runtime
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
52
  - - "~>"
53
53
  - !ruby/object:Gem::Version
54
- version: 3.3.4
54
+ version: 1.0.0
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: bundler
57
57
  requirement: !ruby/object:Gem::Requirement