oktobertest 0.4.0 → 0.5.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/oktobertest.rb +8 -4
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 72c72a5a6e49e971da823e50edfb9e10378b9955
|
4
|
+
data.tar.gz: ee42b8542953dd18c27940c1d2afc53d6159ee75
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0602f4d94e75dea0b903257dd53c616f152acd62a8ac368f8e01cf010e5bfac351a86bcefa86ea9362995318ac6339aa1fab4fe1e30b1ac8b94de4c08e353574
|
7
|
+
data.tar.gz: 8bb32802ff543d825742bc64871c471fc7a65a62ab61722915cd03fc293d9795e033b74566068a9e25aaad2226c351576ba3279e9924891454dc9585056ed3d2
|
data/lib/oktobertest.rb
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
module Oktobertest
|
2
|
-
VERSION = '0.
|
2
|
+
VERSION = '0.5.0'
|
3
3
|
|
4
4
|
TestFailed = Class.new StandardError
|
5
5
|
TestSkipped = Class.new StandardError
|
@@ -7,9 +7,9 @@ module Oktobertest
|
|
7
7
|
def self.display_errors
|
8
8
|
puts
|
9
9
|
errors.each do |error|
|
10
|
-
|
10
|
+
backtrace_location = error.backtrace_locations.detect { |l| l.base_label == '<main>' }
|
11
11
|
print error.kind_of?(TestSkipped) ? "\nskip" : "\nerror: #{error.message}"
|
12
|
-
print "\nfile: #{
|
12
|
+
print "\nfile: #{backtrace_location.path}\nline: #{backtrace_location.lineno}\n"
|
13
13
|
end
|
14
14
|
end
|
15
15
|
|
@@ -17,6 +17,10 @@ module Oktobertest
|
|
17
17
|
@errors ||= []
|
18
18
|
end
|
19
19
|
|
20
|
+
def self.exit_status
|
21
|
+
errors.any? { |error| !error.kind_of?(TestSkipped) } ? 1 : 0
|
22
|
+
end
|
23
|
+
|
20
24
|
module Assertions
|
21
25
|
def assert(value, message = nil)
|
22
26
|
message ||= "condition is not true: #{value.inspect}"
|
@@ -122,5 +126,5 @@ end
|
|
122
126
|
|
123
127
|
at_exit do
|
124
128
|
Oktobertest.display_errors
|
125
|
-
exit Oktobertest.
|
129
|
+
exit Oktobertest.exit_status
|
126
130
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: oktobertest
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.5.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Patricio Mac Adden
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-08-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|