minitest_log 0.2.0 → 1.0.0

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: 716851f9c685e15ba71ffea59e47dad1da9343cbf2b9bd23c14f6ce343492085
4
- data.tar.gz: a9609761116629a1c2d34ffd6caa6d435e4028bdcfe1b22df5f21c6312215027
3
+ metadata.gz: 236b57c783822edbb9a07679686b08149677797e5a7a047ec73fc093185fb1ba
4
+ data.tar.gz: 868cc374fad37e8da78356faa0a8d637203132964c47c8ad6b6af6d572175772
5
5
  SHA512:
6
- metadata.gz: 729a1dc2f378cdce0a14be1ab5d67307aad48e47e8c8bc77f446ccdcb5f80f10d0595f0ad12fea71cc3b3fde733160caf0f6b86bdc7b769af12415274c7192a2
7
- data.tar.gz: 2e2418623de37f1f1e6a249f32a6737f68ed719a711315f759f8420f38a70f57979b1368f3fc9d8e3d8c4a85f11eb73bfd685af6c3a7cafaf5cafe45f43ce509
6
+ metadata.gz: a671ea26b34d7aa17791d9bdef45c0162bc5bd21f1645b47ee100ff1ebfe31e4f9e8f78aecd107453e425864600f98c86f306e78cf721e6ed7ce4a39443f3eb0
7
+ data.tar.gz: 07caf2ac34f7ef71875eb9167a4b55b3107004665f118d3b563b153c11f21d3b4441510b918cd199d6c60b1c19cdc070e63e31f562b935f099a7fd96229141ac
data/Gemfile.lock CHANGED
@@ -1,26 +1,26 @@
1
- PATH
2
- remote: .
3
- specs:
4
- minitest_log (0.2.0)
5
- diff-lcs (~> 1.3)
6
- minitest (~> 5.0)
7
-
8
- GEM
9
- remote: https://rubygems.org/
10
- specs:
11
- diff-lcs (1.3)
12
- markdown_helper (2.1.0)
13
- minitest (5.11.3)
14
- rake (10.5.0)
15
-
16
- PLATFORMS
17
- x64-mingw32
18
-
19
- DEPENDENCIES
20
- bundler (~> 1.7)
21
- markdown_helper (~> 2.0)
22
- minitest_log!
23
- rake (~> 10.0)
24
-
25
- BUNDLED WITH
26
- 1.17.3
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ minitest_log (1.0.0)
5
+ diff-lcs (~> 1.3)
6
+ minitest (~> 5.0)
7
+
8
+ GEM
9
+ remote: https://rubygems.org/
10
+ specs:
11
+ diff-lcs (1.3)
12
+ markdown_helper (2.1.0)
13
+ minitest (5.11.3)
14
+ rake (10.5.0)
15
+
16
+ PLATFORMS
17
+ x64-mingw32
18
+
19
+ DEPENDENCIES
20
+ bundler (~> 1.7)
21
+ markdown_helper (~> 2.0)
22
+ minitest_log!
23
+ rake (~> 10.0)
24
+
25
+ BUNDLED WITH
26
+ 1.17.3
data/README.md CHANGED
@@ -1,14 +1,19 @@
1
- [![Gem Version](https://badge.fury.io/rb/minitest_log.svg)](https://badge.fury.io/rb/minitest_log)
2
-
3
1
  # MinitestLog
4
2
 
3
+ [![Gem Version](https://badge.fury.io/rb/minitest_log.svg)](https://badge.fury.io/rb/minitest_log)
5
4
 
6
5
  ```MinitestLog``` gives you three things:
7
6
 
8
7
  - **Nested sections:** Use nested sections to structure your test (and, importantly, its log), so that the test can "tell its story" clearly.
9
- - **Data explication:** Use data-logging methods to log objects. Most collections (```Aray```, ```Hash```, etc.) are automatically logged in detail.
8
+ - **Data explication:** Use data-logging methods to log objects. Most collections (```Array```, ```Hash```, etc.) are automatically logged in detail.
10
9
  - **(And of course) Verdicts:** Use verdict methods to express assertions. Details for the verdict are logged, whether passed or failed.
11
10
 
11
+ ## Installation
12
+
13
+ ```sh
14
+ gem install minitest_log
15
+ ```
16
+
12
17
  ## Contents
13
18
  - [Logs and Sections](#logs-and-sections)
14
19
  - [Nested Sections](#nested-sections)
@@ -25,6 +30,7 @@
25
30
  - [XML Indentation](#xml-indentation)
26
31
  - [Summary](#summary)
27
32
  - [Error Verdict](#error-verdict)
33
+ - [Backtrace Filter](#backtrace-filter)
28
34
  - [Data](#data)
29
35
  - [Strings](#strings)
30
36
  - [Hash-Like Objects](#hash-like-objects)
@@ -69,6 +75,8 @@
69
75
  - [Use Short Verdict Aliases](#use-short-verdict-aliases)
70
76
  - [Avoid Failure Clutter](#avoid-failure-clutter)
71
77
  - [Facilitate Post-Processing](#facilitate-post-processing)
78
+ - [Oh, and Tests](#oh-and-tests)
79
+ - [About This README](#about-this-readme)
72
80
 
73
81
  ## Logs and Sections
74
82
 
@@ -278,13 +286,13 @@ end
278
286
  ```log.xml```:
279
287
  ```xml
280
288
  <log>
281
- <section_ name='My section with timestamp' timestamp='2019-05-07-Tue-10.58.13.155'>
289
+ <section_ name='My section with timestamp' timestamp='2019-05-09-Thu-10.32.53.066'>
282
290
  Section with timestamp.
283
291
  </section_>
284
292
  <section_ name='My section with duration' duration_seconds='0.501'>
285
293
  Section with duration.
286
294
  </section_>
287
- <section_ name='My section with both' timestamp='2019-05-07-Tue-10.58.13.656' duration_seconds='0.500'>
295
+ <section_ name='My section with both' timestamp='2019-05-09-Thu-10.32.53.568' duration_seconds='0.501'>
288
296
  Section with both.
289
297
  </section_>
290
298
  </log>
@@ -356,7 +364,7 @@ end
356
364
  ```xml
357
365
  <log>
358
366
  <section_ name='My unrescued section'>
359
- <uncaught_exception_ timestamp='2019-05-07-Tue-10.58.14.602' class='RuntimeError'>
367
+ <uncaught_exception_ timestamp='2019-05-09-Thu-10.32.54.471' class='RuntimeError'>
360
368
  <message_>
361
369
  Boo!
362
370
  </message_>
@@ -413,7 +421,7 @@ end
413
421
  ```log.xml```:
414
422
  ```xml
415
423
  <log>
416
- <section_ name='Section with potpourri of arguments' a='0' b='1' timestamp='2019-05-07-Tue-10.58.11.338' c='2' d='3' duration_seconds='0.502'>
424
+ <section_ name='Section with potpourri of arguments' a='0' b='1' timestamp='2019-05-09-Thu-10.32.51.426' c='2' d='3' duration_seconds='0.501'>
417
425
  Word More words
418
426
  <rescued_exception_ class='Exception' message='Boo!'>
419
427
  <backtrace_>
@@ -828,6 +836,85 @@ error_verdict.rb:9:in `test_demo'
828
836
  </log>
829
837
  ```
830
838
 
839
+ #### Backtrace Filter
840
+
841
+ By default, a backtrace omits entries containing the token ```minitest```. This keeps the backtrace focussed on your code instead of the gems' code.
842
+
843
+ Override that behavior by specifying ioption ```:backtrace_filter``` with a ```Regexp``` object. Entries matching that pattern will be omitted from the backtrace.
844
+
845
+ ```backtrace_filter.rb```:
846
+ ```ruby
847
+ require 'minitest_log'
848
+ class Test < Minitest::Test
849
+ def test_demo
850
+ MinitestLog.new('default_backtrace_filter.xml') do |log|
851
+ fail 'Boo!'
852
+ end
853
+ MinitestLog.new('custom_backtrace_filter.xml', :backtrace_filter => /xxx/) do |log|
854
+ fail 'Boo!'
855
+ end
856
+ end
857
+ end
858
+ ```
859
+
860
+ ```default_backtrace_filter.xml```:
861
+ ```xml
862
+ <log>
863
+ <uncaught_exception_ timestamp='2019-05-09-Thu-10.32.49.597' class='RuntimeError'>
864
+ <message_>
865
+ Boo!
866
+ </message_>
867
+ <backtrace_>
868
+ <![CDATA[
869
+ backtrace_filter.rb:5:in `block in test_demo'
870
+ backtrace_filter.rb:4:in `new'
871
+ backtrace_filter.rb:4:in `test_demo'
872
+ ]]>
873
+ </backtrace_>
874
+ </uncaught_exception_>
875
+ </log>
876
+ ```
877
+
878
+ ```custom_backtrace_filter.xml```:
879
+ ```xml
880
+ <log>
881
+ <uncaught_exception_ timestamp='2019-05-09-Thu-10.32.49.599' class='RuntimeError'>
882
+ <message_>
883
+ Boo!
884
+ </message_>
885
+ <backtrace_>
886
+ <![CDATA[
887
+ backtrace_filter.rb:8:in `block in test_demo'
888
+ C:/Ruby25-x64/lib/ruby/gems/2.5.0/gems/minitest_log-0.2.0/lib/minitest_log.rb:59:in `initialize'
889
+ backtrace_filter.rb:7:in `new'
890
+ backtrace_filter.rb:7:in `test_demo'
891
+ C:/Ruby25-x64/lib/ruby/gems/2.5.0/gems/minitest-5.11.3/lib/minitest/test.rb:98:in `block (3 levels) in run'
892
+ C:/Ruby25-x64/lib/ruby/gems/2.5.0/gems/minitest-5.11.3/lib/minitest/test.rb:195:in `capture_exceptions'
893
+ C:/Ruby25-x64/lib/ruby/gems/2.5.0/gems/minitest-5.11.3/lib/minitest/test.rb:95:in `block (2 levels) in run'
894
+ C:/Ruby25-x64/lib/ruby/gems/2.5.0/gems/minitest-5.11.3/lib/minitest.rb:265:in `time_it'
895
+ C:/Ruby25-x64/lib/ruby/gems/2.5.0/gems/minitest-5.11.3/lib/minitest/test.rb:94:in `block in run'
896
+ C:/Ruby25-x64/lib/ruby/gems/2.5.0/gems/minitest-5.11.3/lib/minitest.rb:360:in `on_signal'
897
+ C:/Ruby25-x64/lib/ruby/gems/2.5.0/gems/minitest-5.11.3/lib/minitest/test.rb:211:in `with_info_handler'
898
+ C:/Ruby25-x64/lib/ruby/gems/2.5.0/gems/minitest-5.11.3/lib/minitest/test.rb:93:in `run'
899
+ C:/Ruby25-x64/lib/ruby/gems/2.5.0/gems/minitest-5.11.3/lib/minitest.rb:960:in `run_one_method'
900
+ C:/Ruby25-x64/lib/ruby/gems/2.5.0/gems/minitest-5.11.3/lib/minitest.rb:334:in `run_one_method'
901
+ C:/Ruby25-x64/lib/ruby/gems/2.5.0/gems/minitest-5.11.3/lib/minitest.rb:321:in `block (2 levels) in run'
902
+ C:/Ruby25-x64/lib/ruby/gems/2.5.0/gems/minitest-5.11.3/lib/minitest.rb:320:in `each'
903
+ C:/Ruby25-x64/lib/ruby/gems/2.5.0/gems/minitest-5.11.3/lib/minitest.rb:320:in `block in run'
904
+ C:/Ruby25-x64/lib/ruby/gems/2.5.0/gems/minitest-5.11.3/lib/minitest.rb:360:in `on_signal'
905
+ C:/Ruby25-x64/lib/ruby/gems/2.5.0/gems/minitest-5.11.3/lib/minitest.rb:347:in `with_info_handler'
906
+ C:/Ruby25-x64/lib/ruby/gems/2.5.0/gems/minitest-5.11.3/lib/minitest.rb:319:in `run'
907
+ C:/Ruby25-x64/lib/ruby/gems/2.5.0/gems/minitest-5.11.3/lib/minitest.rb:159:in `block in __run'
908
+ C:/Ruby25-x64/lib/ruby/gems/2.5.0/gems/minitest-5.11.3/lib/minitest.rb:159:in `map'
909
+ C:/Ruby25-x64/lib/ruby/gems/2.5.0/gems/minitest-5.11.3/lib/minitest.rb:159:in `__run'
910
+ C:/Ruby25-x64/lib/ruby/gems/2.5.0/gems/minitest-5.11.3/lib/minitest.rb:136:in `run'
911
+ C:/Ruby25-x64/lib/ruby/gems/2.5.0/gems/minitest-5.11.3/lib/minitest.rb:63:in `block in autorun'
912
+ ]]>
913
+ </backtrace_>
914
+ </uncaught_exception_>
915
+ </log>
916
+ ```
917
+
831
918
 
832
919
  ## Data
833
920
 
@@ -1026,7 +1113,7 @@ end
1026
1113
  (?-mix:Bar)
1027
1114
  </data_>
1028
1115
  <data_ name='My time' class='Time' method=':to_s'>
1029
- 2019-05-07 10:58:07 -0500
1116
+ 2019-05-09 10:32:47 -0500
1030
1117
  </data_>
1031
1118
  <data_ name='My uri,' class='URI::HTTPS' method=':to_s'>
1032
1119
  https://www.github.com
@@ -1798,7 +1885,7 @@ end
1798
1885
  <verdict_ method='verdict_assert_same?' outcome='failed' id='another_id' message='Another message'>
1799
1886
  <expected_ class='String' value='&quot;foo&quot;'/>
1800
1887
  <actual_ class='String' value='&quot;foo&quot;'/>
1801
- <exception_ class='Minitest::Assertion' message='Expected &quot;foo&quot; (oid=27958320) to be the same as &quot;foo&quot; (oid=27958340).'>
1888
+ <exception_ class='Minitest::Assertion' message='Expected &quot;foo&quot; (oid=27933780) to be the same as &quot;foo&quot; (oid=27933800).'>
1802
1889
  <backtrace_>
1803
1890
  <![CDATA[
1804
1891
  verdict_assert_same.rb:6:in `block in test_demo_verdict'
@@ -2579,3 +2666,20 @@ If your logs will be parsed in post-processing, you can make that go smoother by
2579
2666
  - ```:error_verdict => true```: so that a log that has errors will also have at least one failed verdict.
2580
2667
 
2581
2668
  See [Options](#options)
2669
+
2670
+ ## Oh, and Tests
2671
+
2672
+ This project's tests generate 135 [logs and other output files](../../tree/master/test/actual), performing 484 verifications.
2673
+
2674
+ - [log_test.rb](../../tree/master/test/log_test.rb)
2675
+ - [verdict_test.rb](../../tree/master/test/verdict_test.rb)
2676
+
2677
+ ## About This README
2678
+
2679
+ This README page is kept "green" because in addition to the tests, there's a rake task that:
2680
+
2681
+ - Executes the [50 example scripts](markdown/readme), capturing their output.
2682
+ - Uses file inclusion to assemble this ```README.md``` file.
2683
+
2684
+ Shameless plug: GitHub flavored markdown does not support file inclusion, but my Ruby gem [markdown_helper](https://rubygems.org/gems/markdown_helper) does. It's a [GitHub project](https://github.com/BurdetteLamar/markdown_helper#markdown-helper), too.
2685
+
@@ -1,3 +1,3 @@
1
1
  class MinitestLog
2
- VERSION = '0.2.0'
2
+ VERSION = '1.0.0'
3
3
  end
data/minitest_log.gemspec CHANGED
@@ -5,10 +5,11 @@ require 'minitest_log/version'
5
5
  Gem::Specification.new do |spec|
6
6
  spec.name = 'minitest_log'
7
7
  spec.version = MinitestLog::VERSION
8
- spec.authors = ['burdettelamar']
8
+ spec.authors = ['Burdette Lamar']
9
9
  spec.email = ['burdettelamar@yahoo.com']
10
10
 
11
- spec.summary = %q{Logging for Ruby-coded testing}
11
+ spec.summary = %q{Logging for testing with Minitest}
12
+ spec.description = "Gem minitest_log uses Minitest, adding structured loging, data explication, and verdicts."
12
13
  spec.homepage = "https://github.com/BurdetteLamar/minitest_log"
13
14
  spec.license = 'MIT'
14
15
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: minitest_log
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 1.0.0
5
5
  platform: ruby
6
6
  authors:
7
- - burdettelamar
7
+ - Burdette Lamar
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-05-07 00:00:00.000000000 Z
11
+ date: 2019-05-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake
@@ -80,7 +80,8 @@ dependencies:
80
80
  - - "~>"
81
81
  - !ruby/object:Gem::Version
82
82
  version: '1.3'
83
- description:
83
+ description: Gem minitest_log uses Minitest, adding structured loging, data explication,
84
+ and verdicts.
84
85
  email:
85
86
  - burdettelamar@yahoo.com
86
87
  executables: []
@@ -126,5 +127,5 @@ rubyforge_project:
126
127
  rubygems_version: 2.7.6
127
128
  signing_key:
128
129
  specification_version: 4
129
- summary: Logging for Ruby-coded testing
130
+ summary: Logging for testing with Minitest
130
131
  test_files: []