spectus 3.0.9 → 3.1.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (64) hide show
  1. checksums.yaml +4 -4
  2. data/LICENSE.md +1 -1
  3. data/README.md +67 -84
  4. data/lib/spectus.rb +3 -5
  5. data/lib/spectus/exam.rb +56 -0
  6. data/lib/spectus/expectation_target.rb +87 -70
  7. data/lib/spectus/requirement_level/base.rb +50 -75
  8. data/lib/spectus/requirement_level/may.rb +17 -0
  9. data/lib/spectus/requirement_level/must.rb +17 -0
  10. data/lib/spectus/requirement_level/should.rb +17 -0
  11. data/lib/spectus/result/common.rb +174 -0
  12. data/lib/spectus/result/fail.rb +40 -17
  13. data/lib/spectus/result/pass.rb +48 -21
  14. metadata +87 -91
  15. data/.gitignore +0 -11
  16. data/.rubocop.yml +0 -1
  17. data/.rubocop_todo.yml +0 -56
  18. data/.travis.yml +0 -28
  19. data/.yardopts +0 -1
  20. data/CODE_OF_CONDUCT.md +0 -13
  21. data/Gemfile +0 -5
  22. data/Rakefile +0 -23
  23. data/VERSION.semver +0 -1
  24. data/bin/console +0 -8
  25. data/bin/setup +0 -6
  26. data/checksum/spectus-2.0.0.gem.sha512 +0 -1
  27. data/checksum/spectus-2.0.1.gem.sha512 +0 -1
  28. data/checksum/spectus-2.0.2.gem.sha512 +0 -1
  29. data/checksum/spectus-2.0.3.gem.sha512 +0 -1
  30. data/checksum/spectus-2.0.4.gem.sha512 +0 -1
  31. data/checksum/spectus-2.1.0.gem.sha512 +0 -1
  32. data/checksum/spectus-2.1.1.gem.sha512 +0 -1
  33. data/checksum/spectus-2.1.2.gem.sha512 +0 -1
  34. data/checksum/spectus-2.1.3.gem.sha512 +0 -1
  35. data/checksum/spectus-2.10.0.gem.sha512 +0 -1
  36. data/checksum/spectus-2.2.0.gem.sha512 +0 -1
  37. data/checksum/spectus-2.3.0.gem.sha512 +0 -1
  38. data/checksum/spectus-2.3.1.gem.sha512 +0 -1
  39. data/checksum/spectus-2.4.0.gem.sha512 +0 -1
  40. data/checksum/spectus-2.5.0.gem.sha512 +0 -1
  41. data/checksum/spectus-2.6.0.gem.sha512 +0 -1
  42. data/checksum/spectus-2.7.0.gem.sha512 +0 -1
  43. data/checksum/spectus-2.7.1.gem.sha512 +0 -1
  44. data/checksum/spectus-2.8.0.gem.sha512 +0 -1
  45. data/checksum/spectus-2.9.0.gem.sha512 +0 -1
  46. data/checksum/spectus-2.9.1.gem.sha512 +0 -1
  47. data/checksum/spectus-2.9.2.gem.sha512 +0 -1
  48. data/checksum/spectus-3.0.0.gem.sha512 +0 -1
  49. data/checksum/spectus-3.0.1.gem.sha512 +0 -1
  50. data/checksum/spectus-3.0.2.gem.sha512 +0 -1
  51. data/checksum/spectus-3.0.3.gem.sha512 +0 -1
  52. data/checksum/spectus-3.0.5.gem.sha512 +0 -1
  53. data/checksum/spectus-3.0.6.gem.sha512 +0 -1
  54. data/checksum/spectus-3.0.7.gem.sha512 +0 -1
  55. data/checksum/spectus-3.0.8.gem.sha512 +0 -1
  56. data/lib/spectus/matchers.rb +0 -33
  57. data/lib/spectus/report.rb +0 -92
  58. data/lib/spectus/requirement_level/high.rb +0 -27
  59. data/lib/spectus/requirement_level/low.rb +0 -27
  60. data/lib/spectus/requirement_level/medium.rb +0 -27
  61. data/lib/spectus/result/base.rb +0 -112
  62. data/lib/spectus/sandbox.rb +0 -61
  63. data/pkg_checksum +0 -12
  64. data/spectus.gemspec +0 -28
@@ -1,61 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Spectus
4
- # This class evaluate the expectation with the passed block.
5
- #
6
- # @api private
7
- #
8
- class Sandbox
9
- # rubocop:disable Style/RescueStandardError
10
-
11
- # Execute the untested code from the passed block against the matcher.
12
- #
13
- # @param matcher [#matches?] The matcher.
14
- # @param negate [Boolean] The negation of the matcher's result.
15
- # @param object [#object_id] The front object which is challenged.
16
- # @param challenges [Array] The list of challenges.
17
- def initialize(matcher, negate, object, *challenges)
18
- @got = negate ^ matcher.matches? do
19
- @actual = challenges.inject(object) do |subject, challenge|
20
- @last_challenge = challenge
21
- @last_challenge.to(subject)
22
- end
23
- end
24
- rescue => e
25
- @exception = e
26
- end
27
-
28
- # rubocop:enable Style/RescueStandardError
29
-
30
- # @!attribute [r] last_challenge
31
- #
32
- # @return [Defi::Challenge] The last evaluated challenge.
33
- attr_reader :last_challenge
34
-
35
- # @!attribute [r] actual
36
- #
37
- # @return [#object_id] The value that the subject return through its
38
- # challenge.
39
- attr_reader :actual
40
-
41
- # @!attribute [r] exception
42
- #
43
- # @return [#exception, nil] Any possible raised exception.
44
- attr_reader :exception
45
-
46
- # @!attribute [r] got
47
- #
48
- # @return [#object_id] The result of the boolean comparison between the
49
- # actual value and the expected value.
50
- attr_reader :got
51
-
52
- # Report to the spec's requirement level if the test is true or false.
53
- #
54
- # @return [Boolean] Report if the test was true or false.
55
- def valid?
56
- return false if defined?(@exception)
57
-
58
- got
59
- end
60
- end
61
- end
data/pkg_checksum DELETED
@@ -1,12 +0,0 @@
1
- #!/usr/bin/env ruby
2
- # frozen_string_literal: true
3
-
4
- require 'digest/sha2'
5
-
6
- gemname = :spectus
7
- ARGV[0] = File.read('VERSION.semver').chomp if ARGV[0].nil?
8
- built_gem_path = "pkg/#{gemname}-#{ARGV[0]}.gem"
9
- checksum = Digest::SHA512.new.hexdigest(File.read(built_gem_path))
10
- checksum_path = "checksum/#{gemname}-#{ARGV[0]}.gem.sha512"
11
-
12
- File.open(checksum_path, 'w') { |f| f.write("#{checksum}\n") }
data/spectus.gemspec DELETED
@@ -1,28 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- Gem::Specification.new do |spec|
4
- spec.name = 'spectus'
5
- spec.version = File.read('VERSION.semver').chomp
6
- spec.authors = ['Cyril Kato']
7
- spec.email = ['contact@cyril.email']
8
-
9
- spec.summary = 'Expectation library with RFC 2119 keywords.'
10
- spec.description = "Expectation library with RFC 2119's requirement levels."
11
- spec.homepage = 'https://github.com/fixrb/spectus'
12
- spec.license = 'MIT'
13
-
14
- spec.files =
15
- `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^test/}) }
16
- spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
17
- spec.require_paths = ['lib']
18
-
19
- spec.add_dependency 'aw', '~> 0.1.6'
20
- spec.add_dependency 'defi', '~> 1.1.5'
21
- spec.add_dependency 'matchi', '~> 1.0.4'
22
-
23
- spec.add_development_dependency 'bundler', '~> 2.0'
24
- spec.add_development_dependency 'rake', '~> 13.0'
25
- spec.add_development_dependency 'rubocop', '~> 0.75'
26
- spec.add_development_dependency 'simplecov', '~> 0.17'
27
- spec.add_development_dependency 'yard', '~> 0.9'
28
- end