yard-doctest 0.1.13 → 0.1.14
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +0 -2
- data/CHANGELOG.md +5 -0
- data/README.md +6 -5
- data/features/yard-doctest.feature +11 -1
- data/lib/yard-doctest.rb +0 -1
- data/lib/yard/doctest/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4952a0dc4b12093ceb7ae21eae44e735412b0c7e5b17e1b71d435f2fbbdce964
|
4
|
+
data.tar.gz: 6b583b324be15b5519435a021293691a3266ce039789928c19bcb59d4a67d4e0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0560d34f0aeaa28034eaa640e0319539098a1848820696044a1cf805f5f77aeca07206d94394cc74b1dc75a1a3f375cb60d91e51c8d623b200dc33d0a2279b4d
|
7
|
+
data.tar.gz: 1092ec6db552c0355bdf7765df7581b6d29ec555ad33143b5a150721f1830083703f823d6f13e8157ec4c4fd5768ee702b7a00b7dcb89551a90724a39262c474
|
data/.travis.yml
CHANGED
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -87,12 +87,12 @@ end
|
|
87
87
|
|
88
88
|
You can run tests for all the examples you've documented.
|
89
89
|
|
90
|
-
First of all, you need to tell YARD to automatically load `yard-doctest` (as well as other plugins)
|
90
|
+
First of all, you need to tell YARD to automatically load `yard-doctest` (as well as other plugins).
|
91
|
+
To do so, add yard-doctest as an automatically loaded plugin in your `.yardops`:
|
91
92
|
|
92
93
|
```bash
|
93
|
-
|
94
|
-
|
95
|
-
$ bundle exec yard config -a autoload_plugins yard-doctest
|
94
|
+
# .yardopts
|
95
|
+
--plugin yard-doctest
|
96
96
|
```
|
97
97
|
|
98
98
|
Next, you'll need to create test helper, which will be required before each of your test. Think about it as `spec_helper.rb` in RSpec or `env.rb` in Cucumber. You should require everything necessary for your examples to run there.
|
@@ -312,7 +312,8 @@ There is also a Rake task for you:
|
|
312
312
|
|
313
313
|
```ruby
|
314
314
|
# Rakefile
|
315
|
-
require 'yard
|
315
|
+
require 'yard/doctest/rake'
|
316
|
+
|
316
317
|
YARD::Doctest::RakeTask.new do |task|
|
317
318
|
task.doctest_opts = %w[-v]
|
318
319
|
task.pattern = 'lib/**/*.rb'
|
@@ -5,6 +5,15 @@ Feature: yard doctest
|
|
5
5
|
I want to automatically parse YARD's @example tags
|
6
6
|
And use them as tests
|
7
7
|
Just like doctest in Python
|
8
|
+
|
9
|
+
Background:
|
10
|
+
# YARD stopped auto-loading all plugins at 0.6.2, so anything newer needs
|
11
|
+
# the plugin explicitly loaded. A simple way to do this is to always have
|
12
|
+
# a `.yardopts` that loads `yard-doctest`.
|
13
|
+
Given a file named ".yardopts" with:
|
14
|
+
"""
|
15
|
+
--plugin yard-doctest
|
16
|
+
"""
|
8
17
|
|
9
18
|
Scenario: adds new command to yard
|
10
19
|
When I run `bundle exec yard --help`
|
@@ -367,7 +376,7 @@ Feature: yard doctest
|
|
367
376
|
"""
|
368
377
|
And a file named "Rakefile" with:
|
369
378
|
"""
|
370
|
-
require 'yard
|
379
|
+
require 'yard/doctest/rake'
|
371
380
|
YARD::Doctest::RakeTask.new do |task|
|
372
381
|
task.doctest_opts = %w[-v]
|
373
382
|
task.pattern = 'app/**/*.rb'
|
@@ -721,6 +730,7 @@ Feature: yard doctest
|
|
721
730
|
"""
|
722
731
|
And a file named ".yardopts" with:
|
723
732
|
"""
|
733
|
+
--plugin yard-doctest
|
724
734
|
--exclude lib/lib.rb
|
725
735
|
"""
|
726
736
|
When I run `bundle exec yard doctest`
|
data/lib/yard-doctest.rb
CHANGED
data/lib/yard/doctest/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: yard-doctest
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.14
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Alex Rodionov
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2019-02-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: yard
|