oktobertest 0.3.0 → 0.4.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 7cb35368edf512830d4110c4c069433b1fabb3b4
4
- data.tar.gz: fd17bfa67fe3cd2ef280c83bb73a9b1c725147fa
3
+ metadata.gz: 79b0f7a99c9fddc8481ecae81a08ee72385d8ba6
4
+ data.tar.gz: 01be95bea577ec57745d978db9d04c698366626d
5
5
  SHA512:
6
- metadata.gz: de83acb718335476690b83f2f1d08b8d5971d645044286416f62617bea065cad1967d0de7e518d2ff264133b9dbb3d0480e465d0744ede4679e7918f9fc97003
7
- data.tar.gz: 8e5d77c81b2b9c5edb7341ed242cd1ada37de76d4d2788efab0cb397808ebd7926c54f4a16efcb080e72bb74656de1e3a237836d7f90f013d6cc6f2e065869b0
6
+ metadata.gz: b3c96df7810b45291270889f290a21c6cc735db228660163d276792229e585136797cacb42faed5d3f384762026f123dd845e78f9b9b38e443cf81d7f51556ac
7
+ data.tar.gz: b422d5f18510391054e484ad7f67cc2377ec4aec9ff3b0238c1deb9083217bc9e0d312e9e875b1c218d6fa98169ff2dfea64db502df24dff6972137ab72d308b
data/lib/oktobertest.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  module Oktobertest
2
- VERSION = '0.3.0'
2
+ VERSION = '0.4.0'
3
3
 
4
4
  TestFailed = Class.new StandardError
5
5
  TestSkipped = Class.new StandardError
@@ -120,4 +120,7 @@ module Kernel
120
120
  end
121
121
  end
122
122
 
123
- at_exit { Oktobertest.display_errors }
123
+ at_exit do
124
+ Oktobertest.display_errors
125
+ exit Oktobertest.errors.any? { |error| !error.kind_of?(Oktobertest::TestSkipped) } ? 1 : 0
126
+ end
@@ -1,57 +1,85 @@
1
1
  require 'helper'
2
2
 
3
3
  scope do
4
- test 'successful run' do
5
- expected = ".\n"
6
- output = %x(ruby -I lib:test test/fixtures/successful_test.rb)
7
- assert expected == output
4
+ scope 'successful run' do
5
+ test 'output' do
6
+ expected = ".\n"
7
+ output = %x(ruby -I lib:test test/fixtures/successful_test.rb)
8
+ assert expected == output
9
+ end
10
+
11
+ test 'exit status == 0' do
12
+ %x(ruby -I lib:test test/fixtures/successful_test.rb)
13
+ assert 0 == $?.exitstatus
14
+ end
8
15
  end
9
16
 
10
- test 'errored run' do
11
- expected = <<EOS
17
+ scope 'errored run' do
18
+ test 'output' do
19
+ expected = <<EOS
12
20
  E
13
21
 
14
22
  error: RuntimeError
15
23
  file: test/fixtures/error_test.rb
16
24
  line: 4
17
25
  EOS
18
- output = %x(ruby -I lib:test test/fixtures/error_test.rb)
19
- assert expected == output
26
+ output = %x(ruby -I lib:test test/fixtures/error_test.rb)
27
+ assert expected == output
28
+ end
29
+
30
+ test 'exit status == 1' do
31
+ %x(ruby -I lib:test test/fixtures/error_test.rb)
32
+ assert 1 == $?.exitstatus
33
+ end
20
34
  end
21
35
 
22
- test 'failed run' do
23
- expected = <<EOS
36
+ scope 'failed run' do
37
+ test 'output' do
38
+ expected = <<EOS
24
39
  F
25
40
 
26
41
  error: condition is not true: false
27
42
  file: test/fixtures/failing_test.rb
28
43
  line: 4
29
44
  EOS
30
- output = %x(ruby -I lib:test test/fixtures/failing_test.rb)
31
- assert expected == output
45
+ output = %x(ruby -I lib:test test/fixtures/failing_test.rb)
46
+ assert expected == output
47
+ end
48
+
49
+ test 'exit status == 1' do
50
+ %x(ruby -I lib:test test/fixtures/failing_test.rb)
51
+ assert 1 == $?.exitstatus
52
+ end
32
53
  end
33
54
 
34
- test 'run with skipped tests' do
35
- expected = <<EOS
55
+ scope 'run with skipped tests' do
56
+ test 'output' do
57
+ expected = <<EOS
36
58
  S
37
59
 
38
60
  skip
39
61
  file: test/fixtures/skipped_test.rb
40
62
  line: 4
41
63
  EOS
42
- output = %x(ruby -I lib:test test/fixtures/skipped_test.rb)
43
- assert expected == output
64
+ output = %x(ruby -I lib:test test/fixtures/skipped_test.rb)
65
+ assert expected == output
66
+ end
67
+
68
+ test 'exit status == 0' do
69
+ %x(ruby -I lib:test test/fixtures/skipped_test.rb)
70
+ assert 0 == $?.exitstatus
71
+ end
44
72
  end
45
73
 
46
74
  test 'run only one scope' do
47
75
  expected = "..\n"
48
- output = %x(SCOPE='run this' ruby -I lib:test test/fixtures/run_scope_test.rb)
76
+ output = %x(S='run this' ruby -I lib:test test/fixtures/run_scope_test.rb)
49
77
  assert expected == output
50
78
  end
51
79
 
52
80
  test 'run only one test' do
53
81
  expected = ".\n"
54
- output = %x(TEST='run this' ruby -I lib:test test/fixtures/run_test_test.rb)
82
+ output = %x(T='run this' ruby -I lib:test test/fixtures/run_test_test.rb)
55
83
  assert expected == output
56
84
  end
57
85
  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.3.0
4
+ version: 0.4.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-07 00:00:00.000000000 Z
11
+ date: 2014-06-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler