gloo-test 1.3 → 1.4

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 4487381d226f57da2c903ba429b55ad0df105b2f33f765ff0d82eaa89d63adf1
4
- data.tar.gz: d2fa596dd35c471998d3186b1234053c8ee3464cbf596ac07206dcbb3b5a0646
3
+ metadata.gz: 4dfc0f6425cf939267eda29265a6145d1f30db09ea0fdc7494e85d920bd17399
4
+ data.tar.gz: ec80b8ccd8149243c0d3f6f458196ecd54b8dab0705082cc1328004ba3efa1ca
5
5
  SHA512:
6
- metadata.gz: e1addf250dd2716c409a1fa723463a325786d98ba3c1ccb03ae1f9d9ee8ad001f7a3752186ab105ac31e499b8e2ea0c4a831db1b72372899cfc15218c572be76
7
- data.tar.gz: 9dc962225a118a28757d033c60ed1cbc7d7406ff66763b56933019ff64208ac250a245fe796becdefb79cfd5d659583004f2bfdb1a4e0611c49d423f0a48a6fe
6
+ metadata.gz: 83092cf5af2264484ca3d1fcee69e93746e01d4e7ba307e4e4d85db471fae053d92e0b385c96d4f65c1d59d8f9491874478507fb2976cff1d2bb0f901ad055e7
7
+ data.tar.gz: f3e4e1688f1390b1056e07006cbf1b98ba261dcf3557ca14491701ef0b827fd737739c96e92111c4851c372f3ca9db8e0caecddbc931b52778e0a49cda2cbe47
data/README.md CHANGED
@@ -10,6 +10,8 @@ Loaded automatically when running gloo in test mode:
10
10
  > gloo --test ./path/to/tests/
11
11
  ```
12
12
 
13
+ The run reports whether it passed: no test failed, and nothing was logged that no test expected. gloo uses that for its exit status (0 or 1), so scripts and CI can tell a failing run. See Testing in the gloo docs for how to write tests.
14
+
13
15
  It can also be loaded explicitly in a script, like any other core library:
14
16
 
15
17
  ```gloo
data/lib/results.rb CHANGED
@@ -72,6 +72,17 @@ class Results
72
72
  # Show Results
73
73
  # ---------------------------------------------------------------------
74
74
 
75
+ #
76
+ # Did the run as a whole pass? True when no test failed and nothing
77
+ # was logged that a test didn't expect (what the logged summary
78
+ # reports). gloo uses this for its exit status.
79
+ #
80
+ def passed?
81
+ return false if @fail_count.positive?
82
+
83
+ return get_logged_summary.nil?
84
+ end
85
+
75
86
  #
76
87
  # Show the results.
77
88
  #
data/lib/test_runner.rb CHANGED
@@ -18,6 +18,7 @@ class TestRunner
18
18
 
19
19
  #
20
20
  # Execute all tests and display results.
21
+ # Returns true if the run passed (see Results#passed?), false if not.
21
22
  #
22
23
  def run
23
24
  # Count only what's logged from here on, not loading gloo-test.
@@ -32,6 +33,7 @@ class TestRunner
32
33
  @results.show_failures
33
34
  @results.show_results
34
35
  @engine.log.debug "TestRunner is finished"
36
+ return @results.passed?
35
37
  end
36
38
 
37
39
  #
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gloo-test
3
3
  version: !ruby/object:Gem::Version
4
- version: '1.3'
4
+ version: '1.4'
5
5
  platform: ruby
6
6
  authors:
7
7
  - Eric Crane