fix 0.18.2 → 1.0.0.beta1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (57) hide show
  1. checksums.yaml +4 -4
  2. data/LICENSE.md +1 -1
  3. data/README.md +36 -69
  4. data/lib/fix.rb +5 -8
  5. data/lib/fix/context.rb +147 -0
  6. data/lib/fix/expectation_result_not_found_error.rb +5 -0
  7. data/lib/fix/it.rb +15 -25
  8. data/lib/fix/suspicious_success_error.rb +5 -0
  9. data/lib/kernel.rb +9 -0
  10. metadata +29 -86
  11. data/.gitignore +0 -11
  12. data/.rubocop.yml +0 -1
  13. data/.rubocop_todo.yml +0 -25
  14. data/.travis.yml +0 -28
  15. data/.yardopts +0 -1
  16. data/CODE_OF_CONDUCT.md +0 -13
  17. data/Gemfile +0 -5
  18. data/Rakefile +0 -23
  19. data/VERSION.semver +0 -1
  20. data/bin/console +0 -8
  21. data/bin/setup +0 -6
  22. data/checksum/fix-0.0.1.pre.gem.sha512 +0 -1
  23. data/checksum/fix-0.1.0.gem.sha512 +0 -1
  24. data/checksum/fix-0.1.0.pre.gem.sha512 +0 -1
  25. data/checksum/fix-0.10.0.gem.sha512 +0 -1
  26. data/checksum/fix-0.11.0.gem.sha512 +0 -1
  27. data/checksum/fix-0.11.1.gem.sha512 +0 -1
  28. data/checksum/fix-0.12.0.gem.sha512 +0 -1
  29. data/checksum/fix-0.12.1.gem.sha512 +0 -1
  30. data/checksum/fix-0.12.2.gem.sha512 +0 -1
  31. data/checksum/fix-0.12.3.gem.sha512 +0 -1
  32. data/checksum/fix-0.13.0.gem.sha512 +0 -1
  33. data/checksum/fix-0.14.0.gem.sha512 +0 -1
  34. data/checksum/fix-0.14.1.gem.sha512 +0 -1
  35. data/checksum/fix-0.15.0.gem.sha512 +0 -1
  36. data/checksum/fix-0.15.2.gem.sha512 +0 -1
  37. data/checksum/fix-0.16.0.gem.sha512 +0 -1
  38. data/checksum/fix-0.17.0.gem.sha512 +0 -1
  39. data/checksum/fix-0.17.1.gem.sha512 +0 -1
  40. data/checksum/fix-0.17.2.gem.sha512 +0 -1
  41. data/checksum/fix-0.18.0.gem.sha512 +0 -1
  42. data/checksum/fix-0.18.1.gem.sha512 +0 -1
  43. data/checksum/fix-0.2.0.gem.sha512 +0 -1
  44. data/checksum/fix-0.3.0.gem.sha512 +0 -1
  45. data/checksum/fix-0.4.0.gem.sha512 +0 -1
  46. data/checksum/fix-0.5.0.gem.sha512 +0 -1
  47. data/checksum/fix-0.6.0.gem.sha512 +0 -1
  48. data/checksum/fix-0.6.1.gem.sha512 +0 -1
  49. data/checksum/fix-0.7.0.gem.sha512 +0 -1
  50. data/checksum/fix-0.8.0.gem.sha512 +0 -1
  51. data/checksum/fix-0.9.0.gem.sha512 +0 -1
  52. data/checksum/fix-0.9.1.gem.sha512 +0 -1
  53. data/fix.gemspec +0 -29
  54. data/lib/fix/on.rb +0 -139
  55. data/lib/fix/report.rb +0 -120
  56. data/lib/fix/test.rb +0 -89
  57. data/pkg_checksum +0 -12
@@ -1,89 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Fix
4
- # Wraps the target of the specs document.
5
- #
6
- # @api private
7
- #
8
- class Test
9
- # Initialize the test class.
10
- #
11
- # @param front_object [BasicObject] The front object of the test.
12
- # @param options [Hash] Some options.
13
- # @param specs [Proc] The specs to test against the object.
14
- def initialize(front_object, verbose: true, color: true, **options, &specs)
15
- @configuration = options.merge(
16
- verbose: verbose,
17
- color: color
18
- )
19
-
20
- start_time = ::Time.now
21
-
22
- g = On.new(front_object, [], [], {}, @configuration)
23
- g.instance_eval(&specs)
24
-
25
- @results = g.results
26
- @total_time = ::Time.now - start_time
27
- end
28
-
29
- # @!attribute [r] configuration
30
- #
31
- # @return [Hash] The settings.
32
- attr_reader :configuration
33
-
34
- # @!attribute [r] results
35
- #
36
- # @return [Array] The results.
37
- attr_reader :results
38
-
39
- # @!attribute [r] total_time
40
- #
41
- # @return [Float] The total time.
42
- attr_reader :total_time
43
-
44
- # Some statistics.
45
- #
46
- # @return [Hash] Some statistics.
47
- def statistics
48
- {
49
- pass_percent: pass_percent,
50
- total_infos: results.count { |r| r.to_sym.equal?(:info) },
51
- total_failures: results.count { |r| r.to_sym.equal?(:failure) },
52
- total_errors: results.count { |r| r.to_sym.equal?(:error) }
53
- }
54
- end
55
-
56
- # The report of the test.
57
- #
58
- # @return [Report] The report of the test.
59
- def report
60
- Report.new(self)
61
- end
62
-
63
- # The state of the test.
64
- #
65
- # @return [Boolean] Return true if the test pass.
66
- def pass?
67
- results.all?(&:result?)
68
- end
69
-
70
- # @return [Boolean] Return false if the test fail.
71
- def fail?
72
- !pass?
73
- end
74
-
75
- private
76
-
77
- # @private
78
- #
79
- # @return [Fixnum] Return the percentage of passing specs.
80
- def pass_percent
81
- return 100 if results.empty?
82
-
83
- (results.count(&:result?) / results.length.to_f * 100).round
84
- end
85
- end
86
- end
87
-
88
- require_relative 'on'
89
- require_relative 'report'
@@ -1,12 +0,0 @@
1
- #!/usr/bin/env ruby
2
- # frozen_string_literal: true
3
-
4
- require 'digest/sha2'
5
-
6
- gemname = :fix
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") }