spectus 2.1.0 → 2.1.1

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
  SHA1:
3
- metadata.gz: 4e7aff59bbeafa35f8d48f0ad922c18b67b3ab67
4
- data.tar.gz: 4fc80ff8c310a2f088182976c0c1a770291c375e
3
+ metadata.gz: 0a7878d64742e23ef85495332462015efd57b40f
4
+ data.tar.gz: 009d0f0eea1dc8529587b222f48a4bae99a6de2a
5
5
  SHA512:
6
- metadata.gz: d7bad2346b48569a149e01e486990b64f62a999b2a98f4f5530868f6ad43f835e2b6c87d77f30dc922e53f476996926e1a7cadfde8a44d06c303ff9d2ab461a0
7
- data.tar.gz: 96073c63f2c891acf9a44e46fc36b1fea47204c288699712a4205480ee80f264c449eef926cf30a76670896ec896f055b1dd0fd83affb133e56c0b076df10443
6
+ metadata.gz: 9064084d7e0107861d5dbbb7c05e6f2f1ae718553c5064d15b81d63c8aaac24305e8dfee62438148439930dda8fb74926f56a342eb2051c5ef895c7d193ff243
7
+ data.tar.gz: ffe73a13c39efeed1253cc7b66cc65fe5a1ff5bcdd47a5e1b3d6b7caf1324a47189757473ca4c7c7ec920ae8ff75ac4d99c8c9b51b749d25325df8d727ec6321
checksums.yaml.gz.sig CHANGED
Binary file
data.tar.gz.sig CHANGED
Binary file
data/README.md CHANGED
@@ -89,7 +89,8 @@ Spectus.this { BasicObject.superclass }.SHOULD Equal: NilClass
89
89
  # => #<Spectus::Result::Pass:0x007fa41c2f1d00 @message="passing spec", @subject=#<Proc:0x007fa41c2f2110@(irb):3>, @challenge=:call, @context=[], @actual=nil, @expected={:Equal=>NilClass}, @got=false, @error=nil, @level=:Medium, @negate=false, @valid=false>
90
90
  ```
91
91
 
92
- Even if the sole instance of `NilClass` (`nil`) was returned, there isn't any exception so the result of the test shows that the spec passed.
92
+ Instead of the expected `NilClass` class, its sole instance (which is `nil`) was returned.
93
+ However, because there isn't any exception, the result of the test shows that the spec passed.
93
94
 
94
95
  ### Not recommended
95
96
 
@@ -104,14 +105,14 @@ There was a `TypeError` exception, the result of the test shows that the spec fa
104
105
 
105
106
  ### Optional
106
107
 
107
- Given the `"foo"` object, when it receives `bar` method, then it **MAY** match the regular expression `/^foo$/`:
108
+ Given the `"foo"` object, when it receives `blank?` method, then it **MAY** be `false`:
108
109
 
109
110
  ```ruby
110
111
  Spectus.this { 'foo'.blank? }.MAY :BeFalse
111
112
  # => #<Spectus::Result::Pass:0x007fa41c2bae18 @message="passing spec", @subject=#<Proc:0x007fa41c2bb368@(irb):6>, @challenge=:call, @context=[], @actual=nil, @expected=:BeFalse, @got=nil, @error=#<NoMethodError: undefined method `blank?' for "foo":String>, @level=:Low, @negate=false, @valid=false>
112
113
  ```
113
114
 
114
- The optional `blank?` method is not implemented (unlike in [Ruby on Rails](http://api.rubyonrails.org/classes/Object.html#method-i-blank-3F) for instance), so the result of the test shows that the spec passed.
115
+ The optional `blank?` method is not implemented (unlike in [Ruby on Rails](http://api.rubyonrails.org/classes/Object.html#method-i-blank-3F), for instance), so the result of the test shows that the spec passed.
115
116
 
116
117
  ## Versioning
117
118
 
data/Rakefile CHANGED
@@ -1,5 +1,8 @@
1
1
  require 'bundler/gem_tasks'
2
2
  require 'rake/testtask'
3
+ require 'rubocop/rake_task'
4
+
5
+ RuboCop::RakeTask.new
3
6
 
4
7
  Rake::TestTask.new do |t|
5
8
  t.verbose = true
@@ -14,4 +17,4 @@ namespace :test do
14
17
  end
15
18
 
16
19
  task(:doc_stats) { ruby '-S yard stats' }
17
- task default: [:test, :doc_stats]
20
+ task default: [:test, :doc_stats, :rubocop]
data/VERSION.semver CHANGED
@@ -1 +1 @@
1
- 2.1.0
1
+ 2.1.1
data/spectus.gemspec CHANGED
@@ -10,17 +10,17 @@ Gem::Specification.new do |spec|
10
10
  spec.license = 'MIT'
11
11
 
12
12
  spec.files =
13
- `git ls-files -z`.split("\x0").reject { |f| f.match(/%r{^test}/) }
14
- spec.executables = spec.files.grep(/%r{^exe}/) { |f| File.basename(f) }
13
+ `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^test/}) }
14
+ spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
15
15
  spec.require_paths = ['lib']
16
16
 
17
- spec.add_dependency 'matchi', '~> 0.0.6'
17
+ spec.add_dependency 'matchi', '~> 0.0'
18
18
 
19
- spec.add_development_dependency 'bundler', '~> 1.9'
19
+ spec.add_development_dependency 'bundler', '~> 1.10'
20
20
  spec.add_development_dependency 'rake', '~> 10.4'
21
21
  spec.add_development_dependency 'yard', '~> 0.8'
22
22
  spec.add_development_dependency 'simplecov', '~> 0.10'
23
- spec.add_development_dependency 'rubocop', '~> 0.31'
23
+ spec.add_development_dependency 'rubocop', '~> 0.32'
24
24
 
25
25
  private_key = File.expand_path '~/.gem/spectus-gem-private_key.pem'
26
26
  if File.exist? private_key
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: spectus
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.0
4
+ version: 2.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Cyril Wack
@@ -30,7 +30,7 @@ cert_chain:
30
30
  zeYBFLJQAl0AQPaGujsG5tssIabiNy1ryydKAjWkNDxqLgvtwST3L0Qr9UQFQgoA
31
31
  O2Rl8PjSD+2P9XE7T2x1xQ==
32
32
  -----END CERTIFICATE-----
33
- date: 2015-05-19 00:00:00.000000000 Z
33
+ date: 2015-07-25 00:00:00.000000000 Z
34
34
  dependencies:
35
35
  - !ruby/object:Gem::Dependency
36
36
  name: matchi
@@ -38,28 +38,28 @@ dependencies:
38
38
  requirements:
39
39
  - - "~>"
40
40
  - !ruby/object:Gem::Version
41
- version: 0.0.6
41
+ version: '0.0'
42
42
  type: :runtime
43
43
  prerelease: false
44
44
  version_requirements: !ruby/object:Gem::Requirement
45
45
  requirements:
46
46
  - - "~>"
47
47
  - !ruby/object:Gem::Version
48
- version: 0.0.6
48
+ version: '0.0'
49
49
  - !ruby/object:Gem::Dependency
50
50
  name: bundler
51
51
  requirement: !ruby/object:Gem::Requirement
52
52
  requirements:
53
53
  - - "~>"
54
54
  - !ruby/object:Gem::Version
55
- version: '1.9'
55
+ version: '1.10'
56
56
  type: :development
57
57
  prerelease: false
58
58
  version_requirements: !ruby/object:Gem::Requirement
59
59
  requirements:
60
60
  - - "~>"
61
61
  - !ruby/object:Gem::Version
62
- version: '1.9'
62
+ version: '1.10'
63
63
  - !ruby/object:Gem::Dependency
64
64
  name: rake
65
65
  requirement: !ruby/object:Gem::Requirement
@@ -108,14 +108,14 @@ dependencies:
108
108
  requirements:
109
109
  - - "~>"
110
110
  - !ruby/object:Gem::Version
111
- version: '0.31'
111
+ version: '0.32'
112
112
  type: :development
113
113
  prerelease: false
114
114
  version_requirements: !ruby/object:Gem::Requirement
115
115
  requirements:
116
116
  - - "~>"
117
117
  - !ruby/object:Gem::Version
118
- version: '0.31'
118
+ version: '0.32'
119
119
  description: Expectation library with RFC 2119's requirement levels.
120
120
  email:
121
121
  - contact@cyril.email
@@ -148,13 +148,6 @@ files:
148
148
  - lib/spectus/sandbox.rb
149
149
  - spectus-gem-public_cert.pem
150
150
  - spectus.gemspec
151
- - test/support/coverage.rb
152
- - test/test_high_fail.rb
153
- - test/test_high_pass.rb
154
- - test/test_low_fail.rb
155
- - test/test_low_pass.rb
156
- - test/test_medium_fail.rb
157
- - test/test_medium_pass.rb
158
151
  homepage: https://github.com/fixrb/spectus
159
152
  licenses:
160
153
  - MIT
metadata.gz.sig CHANGED
Binary file
@@ -1,3 +0,0 @@
1
- require 'simplecov'
2
-
3
- SimpleCov.start
@@ -1,140 +0,0 @@
1
- require_relative File.join 'support', 'coverage'
2
- require_relative File.join '..', 'lib', 'spectus'
3
-
4
- subject = -> { 'foo'.upcase }
5
-
6
- begin
7
- Spectus.this(&subject).MUST(Eql: 'foo')
8
- rescue Spectus::Result::Fail => raised_result
9
- raise 'failing test' unless raised_result.to_char == 'F'
10
- raise 'failing test' unless raised_result.to_h == {
11
- subject: subject,
12
- challenge: :call,
13
- context: [],
14
- actual: 'FOO',
15
- expected: { Eql: 'foo' },
16
- got: false,
17
- error: nil,
18
- level: :High,
19
- negate: false,
20
- valid: false,
21
- result: false
22
- }
23
-
24
- print '.'
25
- end
26
-
27
- begin
28
- Spectus.this(&subject).MUST_NOT(Eql: 'FOO')
29
- rescue Spectus::Result::Fail => raised_result
30
- raise 'failing test' unless raised_result.to_char == 'F'
31
- raise 'failing test' unless raised_result.to_h == {
32
- subject: subject,
33
- challenge: :call,
34
- context: [],
35
- actual: 'FOO',
36
- expected: { Eql: 'FOO' },
37
- got: false,
38
- error: nil,
39
- level: :High,
40
- negate: true,
41
- valid: false,
42
- result: false
43
- }
44
-
45
- print '.'
46
- end
47
-
48
- subject = -> { 'foo'.bar }
49
-
50
- begin
51
- Spectus.this(&subject).MUST(Eql: 'foo')
52
- rescue Spectus::Result::Fail => raised_result
53
- raise 'failing test' unless raised_result.error.class == NoMethodError
54
- raise 'failing test' unless raised_result.to_char == 'E'
55
- raise 'failing test' unless raised_result.to_h == {
56
- subject: subject,
57
- challenge: :call,
58
- context: [],
59
- actual: nil,
60
- expected: { Eql: 'foo' },
61
- got: nil,
62
- error: raised_result.error,
63
- level: :High,
64
- negate: false,
65
- valid: false,
66
- result: false
67
- }
68
-
69
- print '.'
70
- end
71
-
72
- begin
73
- Spectus.this(&subject).MUST_NOT(Eql: 'foo')
74
- rescue Spectus::Result::Fail => raised_result
75
- raise 'failing test' unless raised_result.error.class == NoMethodError
76
- raise 'failing test' unless raised_result.to_char == 'E'
77
- raise 'failing test' unless raised_result.to_h == {
78
- subject: subject,
79
- challenge: :call,
80
- context: [],
81
- actual: nil,
82
- expected: { Eql: 'foo' },
83
- got: nil,
84
- error: raised_result.error,
85
- level: :High,
86
- negate: true,
87
- valid: false,
88
- result: false
89
- }
90
-
91
- print '.'
92
- end
93
-
94
- subject = -> { 'foo'.upcase(:bar) }
95
-
96
- begin
97
- Spectus.this(&subject).MUST(Eql: 'foo')
98
- rescue Spectus::Result::Fail => raised_result
99
- raise 'failing test' unless raised_result.error.class == ArgumentError
100
- raise 'failing test' unless raised_result.to_char == 'E'
101
- raise 'failing test' unless raised_result.to_h == {
102
- subject: subject,
103
- challenge: :call,
104
- context: [],
105
- actual: nil,
106
- expected: { Eql: 'foo' },
107
- got: nil,
108
- error: raised_result.error,
109
- level: :High,
110
- negate: false,
111
- valid: false,
112
- result: false
113
- }
114
-
115
- print '.'
116
- end
117
-
118
- begin
119
- Spectus.this(&subject).MUST_NOT(Eql: 'foo')
120
- rescue Spectus::Result::Fail => raised_result
121
- raise 'failing test' unless raised_result.error.class == ArgumentError
122
- raise 'failing test' unless raised_result.to_char == 'E'
123
- raise 'failing test' unless raised_result.to_h == {
124
- subject: subject,
125
- challenge: :call,
126
- context: [],
127
- actual: nil,
128
- expected: { Eql: 'foo' },
129
- got: nil,
130
- error: raised_result.error,
131
- level: :High,
132
- negate: true,
133
- valid: false,
134
- result: false
135
- }
136
-
137
- print '.'
138
- end
139
-
140
- puts
@@ -1,44 +0,0 @@
1
- require_relative File.join 'support', 'coverage'
2
- require_relative File.join '..', 'lib', 'spectus'
3
-
4
- subject = -> { 'foo'.upcase }
5
-
6
- result = Spectus.this(&subject).MUST(Eql: 'FOO')
7
-
8
- fail 'failing test' unless result.to_char == '.'
9
- fail 'failing test' unless result.to_h == {
10
- subject: subject,
11
- challenge: :call,
12
- context: [],
13
- actual: 'FOO',
14
- expected: { Eql: 'FOO' },
15
- got: true,
16
- error: nil,
17
- level: :High,
18
- negate: false,
19
- valid: true,
20
- result: true
21
- }
22
-
23
- print '.'
24
-
25
- result = Spectus.this(&subject).MUST_NOT(Eql: 'foo')
26
-
27
- fail 'failing test' unless result.to_char == '.'
28
- fail 'failing test' unless result.to_h == {
29
- subject: subject,
30
- challenge: :call,
31
- context: [],
32
- actual: 'FOO',
33
- expected: { Eql: 'foo' },
34
- got: true,
35
- error: nil,
36
- level: :High,
37
- negate: true,
38
- valid: true,
39
- result: true
40
- }
41
-
42
- print '.'
43
-
44
- puts
@@ -1,51 +0,0 @@
1
- require_relative File.join 'support', 'coverage'
2
- require_relative File.join '..', 'lib', 'spectus'
3
-
4
- subject = -> { 'foo'.upcase }
5
-
6
- begin
7
- Spectus.this(&subject).MAY(Eql: 'foo')
8
- rescue Spectus::Result::Fail => raised_result
9
- raise 'failing test' unless raised_result.to_char == 'F'
10
- raise 'failing test' unless raised_result.to_h == {
11
- subject: subject,
12
- challenge: :call,
13
- context: [],
14
- actual: 'FOO',
15
- expected: { Eql: 'foo' },
16
- got: false,
17
- error: nil,
18
- level: :Low,
19
- negate: false,
20
- valid: false,
21
- result: false
22
- }
23
-
24
- print '.'
25
- end
26
-
27
- subject = -> { 'foo'.upcase(:bar) }
28
-
29
- begin
30
- Spectus.this(&subject).MAY(Eql: 'foo')
31
- rescue Spectus::Result::Fail => raised_result
32
- raise 'failing test' unless raised_result.error.class == ArgumentError
33
- raise 'failing test' unless raised_result.to_char == 'E'
34
- raise 'failing test' unless raised_result.to_h == {
35
- subject: subject,
36
- challenge: :call,
37
- context: [],
38
- actual: nil,
39
- expected: { Eql: 'foo' },
40
- got: nil,
41
- error: raised_result.error,
42
- level: :Low,
43
- negate: false,
44
- valid: false,
45
- result: false
46
- }
47
-
48
- print '.'
49
- end
50
-
51
- puts
@@ -1,47 +0,0 @@
1
- require_relative File.join 'support', 'coverage'
2
- require_relative File.join '..', 'lib', 'spectus'
3
-
4
- subject = -> { 'foo'.upcase }
5
-
6
- result = Spectus.this(&subject).MAY(Eql: 'FOO')
7
-
8
- fail 'failing test' unless result.to_char == '.'
9
- fail 'failing test' unless result.to_h == {
10
- subject: subject,
11
- challenge: :call,
12
- context: [],
13
- actual: 'FOO',
14
- expected: { Eql: 'FOO' },
15
- got: true,
16
- error: nil,
17
- level: :Low,
18
- negate: false,
19
- valid: true,
20
- result: true
21
- }
22
-
23
- print '.'
24
-
25
- subject = -> { 'foo'.bar }
26
-
27
- result = Spectus.this(&subject).MAY(Eql: 'foo')
28
-
29
- fail 'failing test' unless result.error.class == NoMethodError
30
- fail 'failing test' unless result.to_char == 'I'
31
- fail 'failing test' unless result.to_h == {
32
- subject: subject,
33
- challenge: :call,
34
- context: [],
35
- actual: nil,
36
- expected: { Eql: 'foo' },
37
- got: nil,
38
- error: result.error,
39
- level: :Low,
40
- negate: false,
41
- valid: false,
42
- result: true
43
- }
44
-
45
- print '.'
46
-
47
- puts
@@ -1,50 +0,0 @@
1
- require_relative File.join 'support', 'coverage'
2
- require_relative File.join '..', 'lib', 'spectus'
3
-
4
- subject = -> { 'foo'.bar }
5
-
6
- begin
7
- Spectus.this(&subject).SHOULD(Eql: 'foo')
8
- rescue Spectus::Result::Fail => raised_result
9
- raise 'failing test' unless raised_result.error.class == NoMethodError
10
- raise 'failing test' unless raised_result.to_char == 'E'
11
- raise 'failing test' unless raised_result.to_h == {
12
- subject: subject,
13
- challenge: :call,
14
- context: [],
15
- actual: nil,
16
- expected: { Eql: 'foo' },
17
- got: nil,
18
- error: raised_result.error,
19
- level: :Medium,
20
- negate: false,
21
- valid: false,
22
- result: false
23
- }
24
-
25
- print '.'
26
- end
27
-
28
- begin
29
- Spectus.this(&subject).SHOULD_NOT(Eql: 'foo')
30
- rescue Spectus::Result::Fail => raised_result
31
- raise 'failing test' unless raised_result.error.class == NoMethodError
32
- raise 'failing test' unless raised_result.to_char == 'E'
33
- raise 'failing test' unless raised_result.to_h == {
34
- subject: subject,
35
- challenge: :call,
36
- context: [],
37
- actual: nil,
38
- expected: { Eql: 'foo' },
39
- got: nil,
40
- error: raised_result.error,
41
- level: :Medium,
42
- negate: true,
43
- valid: false,
44
- result: false
45
- }
46
-
47
- print '.'
48
- end
49
-
50
- puts
@@ -1,82 +0,0 @@
1
- require_relative File.join 'support', 'coverage'
2
- require_relative File.join '..', 'lib', 'spectus'
3
-
4
- subject = -> { 'foo'.upcase }
5
-
6
- result = Spectus.this(&subject).SHOULD(Eql: 'foo')
7
-
8
- fail 'failing test' unless result.to_char == 'I'
9
- fail 'failing test' unless result.to_h == {
10
- subject: subject,
11
- challenge: :call,
12
- context: [],
13
- actual: 'FOO',
14
- expected: { Eql: 'foo' },
15
- got: false,
16
- error: nil,
17
- level: :Medium,
18
- negate: false,
19
- valid: false,
20
- result: true
21
- }
22
-
23
- print '.'
24
-
25
- result = Spectus.this(&subject).SHOULD_NOT(Eql: 'foo')
26
-
27
- fail 'failing test' unless result.to_char == '.'
28
- fail 'failing test' unless result.to_h == {
29
- subject: subject,
30
- challenge: :call,
31
- context: [],
32
- actual: 'FOO',
33
- expected: { Eql: 'foo' },
34
- got: true,
35
- error: nil,
36
- level: :Medium,
37
- negate: true,
38
- valid: true,
39
- result: true
40
- }
41
-
42
- print '.'
43
-
44
- result = Spectus.this(&subject).SHOULD(Eql: 'FOO')
45
-
46
- fail 'failing test' unless result.to_char == '.'
47
- fail 'failing test' unless result.to_h == {
48
- subject: subject,
49
- challenge: :call,
50
- context: [],
51
- actual: 'FOO',
52
- expected: { Eql: 'FOO' },
53
- got: true,
54
- error: nil,
55
- level: :Medium,
56
- negate: false,
57
- valid: true,
58
- result: true
59
- }
60
-
61
- print '.'
62
-
63
- result = Spectus.this(&subject).SHOULD_NOT(Eql: 'FOO')
64
-
65
- fail 'failing test' unless result.to_char == 'I'
66
- fail 'failing test' unless result.to_h == {
67
- subject: subject,
68
- challenge: :call,
69
- context: [],
70
- actual: 'FOO',
71
- expected: { Eql: 'FOO' },
72
- got: false,
73
- error: nil,
74
- level: :Medium,
75
- negate: true,
76
- valid: false,
77
- result: true
78
- }
79
-
80
- print '.'
81
-
82
- puts