yard-doctest 0.1.16 → 0.1.17
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 +4 -4
- data/CHANGELOG.md +4 -0
- data/features/yard-doctest.feature +15 -0
- data/lib/yard/doctest/example.rb +4 -2
- data/lib/yard/doctest/version.rb +1 -1
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f721556f4b55dabcdf69108f7f78f96399fca62ffc2640cc31a429701e35a08a
|
4
|
+
data.tar.gz: 5f5b8dcd90038bc6a1a81a3d6ac8e5107ff84739a3e33e910bdb2690431ae983
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fff97d81c77bc83a015b72129ddbd8836571cb78065961fde66d2cbfb9b0545fec87374739ce105ec2cd446f8f2916808279399106136f8cdd8e011bb509668e
|
7
|
+
data.tar.gz: 99eb9f16407894dca37cd1e382bd5be92f85d9bd0ffeaa20a69bdb797517e67cf524ae31fcfb57fad231f333b7541643762b497aabc1b40b96072940c420a077
|
data/CHANGELOG.md
CHANGED
@@ -198,6 +198,7 @@ Feature: yard doctest
|
|
198
198
|
"""
|
199
199
|
When I run `bundle exec yard doctest`
|
200
200
|
Then the output should contain "1 runs, 1 assertions, 0 failures, 0 errors, 0 skips"
|
201
|
+
And the output should not contain "DEPRECATED"
|
201
202
|
Examples:
|
202
203
|
| value |
|
203
204
|
| true |
|
@@ -785,3 +786,17 @@ Feature: yard doctest
|
|
785
786
|
"""
|
786
787
|
app/app.rb:4:in `foo'
|
787
788
|
"""
|
789
|
+
|
790
|
+
Scenario: handles a proc successfully
|
791
|
+
Given a file named "doctest_helper.rb" with:
|
792
|
+
"""
|
793
|
+
require 'app/app'
|
794
|
+
"""
|
795
|
+
And a file named "app/app.rb" with:
|
796
|
+
"""
|
797
|
+
# @example
|
798
|
+
# MyClass.call #=> 1
|
799
|
+
MyClass = lambda { 1 }
|
800
|
+
"""
|
801
|
+
When I run `bundle exec yard doctest`
|
802
|
+
Then the output should contain "1 runs, 1 assertions, 0 failures, 0 errors, 0 skips"
|
data/lib/yard/doctest/example.rb
CHANGED
@@ -45,7 +45,7 @@ module YARD
|
|
45
45
|
end
|
46
46
|
|
47
47
|
global_constants = Object.constants
|
48
|
-
scope_constants = scope.constants if scope
|
48
|
+
scope_constants = scope.constants if scope && scope.respond_to?(:constants)
|
49
49
|
this.asserts.each do |assert|
|
50
50
|
expected, actual = assert[:expected], assert[:actual]
|
51
51
|
if expected.empty?
|
@@ -55,7 +55,7 @@ module YARD
|
|
55
55
|
end
|
56
56
|
end
|
57
57
|
clear_extra_constants(Object, global_constants)
|
58
|
-
clear_extra_constants(scope, scope_constants) if scope
|
58
|
+
clear_extra_constants(scope, scope_constants) if scope && scope.respond_to?(:constants)
|
59
59
|
end
|
60
60
|
end
|
61
61
|
end
|
@@ -78,6 +78,8 @@ module YARD
|
|
78
78
|
assert_equal("#<#{expected.class}: #{expected}>", "#<#{actual.class}: #{actual}>")
|
79
79
|
elsif (error = only_one_is_error?(expected, actual))
|
80
80
|
raise error
|
81
|
+
elsif expected.nil?
|
82
|
+
assert_nil(actual)
|
81
83
|
else
|
82
84
|
assert_equal(expected, actual)
|
83
85
|
end
|
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.17
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Alex Rodionov
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-
|
11
|
+
date: 2019-09-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: yard
|
@@ -120,7 +120,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
120
120
|
- !ruby/object:Gem::Version
|
121
121
|
version: '0'
|
122
122
|
requirements: []
|
123
|
-
|
123
|
+
rubyforge_project:
|
124
|
+
rubygems_version: 2.7.6.2
|
124
125
|
signing_key:
|
125
126
|
specification_version: 4
|
126
127
|
summary: Doctests from YARD examples
|