oktobertest 0.4.0 → 0.5.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/oktobertest.rb +8 -4
  3. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 79b0f7a99c9fddc8481ecae81a08ee72385d8ba6
4
- data.tar.gz: 01be95bea577ec57745d978db9d04c698366626d
3
+ metadata.gz: 72c72a5a6e49e971da823e50edfb9e10378b9955
4
+ data.tar.gz: ee42b8542953dd18c27940c1d2afc53d6159ee75
5
5
  SHA512:
6
- metadata.gz: b3c96df7810b45291270889f290a21c6cc735db228660163d276792229e585136797cacb42faed5d3f384762026f123dd845e78f9b9b38e443cf81d7f51556ac
7
- data.tar.gz: b422d5f18510391054e484ad7f67cc2377ec4aec9ff3b0238c1deb9083217bc9e0d312e9e875b1c218d6fa98169ff2dfea64db502df24dff6972137ab72d308b
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.4.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
- file, line, _ = error.backtrace.detect { |l| !l.match __FILE__ }.split ':'
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: #{file}\nline: #{line}\n"
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.errors.any? { |error| !error.kind_of?(Oktobertest::TestSkipped) } ? 1 : 0
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.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-06-08 00:00:00.000000000 Z
11
+ date: 2014-08-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler