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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c75c418a5cbe791e718cb9ba2deff5f1b187c00ae8578a79d149cda39f567d05
4
- data.tar.gz: e48f64151a5273ddbbc8d0f8efe5327c2f7798d744473ed7ac82e0b49e1b0842
3
+ metadata.gz: f721556f4b55dabcdf69108f7f78f96399fca62ffc2640cc31a429701e35a08a
4
+ data.tar.gz: 5f5b8dcd90038bc6a1a81a3d6ac8e5107ff84739a3e33e910bdb2690431ae983
5
5
  SHA512:
6
- metadata.gz: a6f46775edc0057a440ae41adcc1377a2125015981ac9dc7fd8cc5481754e8f4d4289a66262b7db51489b0ef1039c6dcd12ac825700d5bd22b687f6228979722
7
- data.tar.gz: 69cfad611e30b3f5cd1fc6f672aed1326efd330cc9e6a8a2124316541431d2adf92b0edb71a2a5404f2b0f0a11fac218eec98f1653b36cb6316b80754f1e4c6a
6
+ metadata.gz: fff97d81c77bc83a015b72129ddbd8836571cb78065961fde66d2cbfb9b0545fec87374739ce105ec2cd446f8f2916808279399106136f8cdd8e011bb509668e
7
+ data.tar.gz: 99eb9f16407894dca37cd1e382bd5be92f85d9bd0ffeaa20a69bdb797517e67cf524ae31fcfb57fad231f333b7541643762b497aabc1b40b96072940c420a077
@@ -1,3 +1,7 @@
1
+ ## 0.1.17
2
+
3
+ * Fixed an issue when procs would fail to be tested (thanks @jkantarek)
4
+
1
5
  ## 0.1.16
2
6
 
3
7
  * Pass example instance to hooks to allow for its inspection (thanks @nrser)
@@ -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"
@@ -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
@@ -1,5 +1,5 @@
1
1
  module YARD
2
2
  module Doctest
3
- VERSION = '0.1.16'
3
+ VERSION = '0.1.17'
4
4
  end
5
5
  end
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.16
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-02-08 00:00:00.000000000 Z
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
- rubygems_version: 3.0.1
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