fix 0.18.2 → 1.0.0.beta1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/LICENSE.md +1 -1
- data/README.md +36 -69
- data/lib/fix.rb +5 -8
- data/lib/fix/context.rb +147 -0
- data/lib/fix/expectation_result_not_found_error.rb +5 -0
- data/lib/fix/it.rb +15 -25
- data/lib/fix/suspicious_success_error.rb +5 -0
- data/lib/kernel.rb +9 -0
- metadata +29 -86
- data/.gitignore +0 -11
- data/.rubocop.yml +0 -1
- data/.rubocop_todo.yml +0 -25
- data/.travis.yml +0 -28
- data/.yardopts +0 -1
- data/CODE_OF_CONDUCT.md +0 -13
- data/Gemfile +0 -5
- data/Rakefile +0 -23
- data/VERSION.semver +0 -1
- data/bin/console +0 -8
- data/bin/setup +0 -6
- data/checksum/fix-0.0.1.pre.gem.sha512 +0 -1
- data/checksum/fix-0.1.0.gem.sha512 +0 -1
- data/checksum/fix-0.1.0.pre.gem.sha512 +0 -1
- data/checksum/fix-0.10.0.gem.sha512 +0 -1
- data/checksum/fix-0.11.0.gem.sha512 +0 -1
- data/checksum/fix-0.11.1.gem.sha512 +0 -1
- data/checksum/fix-0.12.0.gem.sha512 +0 -1
- data/checksum/fix-0.12.1.gem.sha512 +0 -1
- data/checksum/fix-0.12.2.gem.sha512 +0 -1
- data/checksum/fix-0.12.3.gem.sha512 +0 -1
- data/checksum/fix-0.13.0.gem.sha512 +0 -1
- data/checksum/fix-0.14.0.gem.sha512 +0 -1
- data/checksum/fix-0.14.1.gem.sha512 +0 -1
- data/checksum/fix-0.15.0.gem.sha512 +0 -1
- data/checksum/fix-0.15.2.gem.sha512 +0 -1
- data/checksum/fix-0.16.0.gem.sha512 +0 -1
- data/checksum/fix-0.17.0.gem.sha512 +0 -1
- data/checksum/fix-0.17.1.gem.sha512 +0 -1
- data/checksum/fix-0.17.2.gem.sha512 +0 -1
- data/checksum/fix-0.18.0.gem.sha512 +0 -1
- data/checksum/fix-0.18.1.gem.sha512 +0 -1
- data/checksum/fix-0.2.0.gem.sha512 +0 -1
- data/checksum/fix-0.3.0.gem.sha512 +0 -1
- data/checksum/fix-0.4.0.gem.sha512 +0 -1
- data/checksum/fix-0.5.0.gem.sha512 +0 -1
- data/checksum/fix-0.6.0.gem.sha512 +0 -1
- data/checksum/fix-0.6.1.gem.sha512 +0 -1
- data/checksum/fix-0.7.0.gem.sha512 +0 -1
- data/checksum/fix-0.8.0.gem.sha512 +0 -1
- data/checksum/fix-0.9.0.gem.sha512 +0 -1
- data/checksum/fix-0.9.1.gem.sha512 +0 -1
- data/fix.gemspec +0 -29
- data/lib/fix/on.rb +0 -139
- data/lib/fix/report.rb +0 -120
- data/lib/fix/test.rb +0 -89
- data/pkg_checksum +0 -12
data/lib/fix/test.rb
DELETED
@@ -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'
|
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 = :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") }
|