inch 0.4.3.rc2 → 0.4.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +6 -0
- data/lib/inch/version.rb +1 -1
- data/test/fixtures/simple/lib/broken.rb +19 -0
- data/test/test_helper.rb +10 -0
- data/test/unit/code_object/proxy/method_object_test.rb +14 -5
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: dab543a34157a4fe5467c6dbb51a94c112f29a83
|
4
|
+
data.tar.gz: 674f4bd46b9f9b23b10bb5b8264f31019fb6d686
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6dc8d3ee59dceb8c04145f470820a28a6aff12d2c3462f893bdafc7b274b243bf6f1b12057606c91b2b0573dc0696334b46c993843d2048acc145a12765d8257
|
7
|
+
data.tar.gz: 1270332e354f079ae12c9548d7f40f96b0c94c1debef1974c710ad80e7e03891bce603ef0fd4c6d89db8c19724b53d204d4e2f5f2c00f7a091453f6718ffdbbb
|
data/CHANGELOG.md
CHANGED
data/lib/inch/version.rb
CHANGED
@@ -224,6 +224,25 @@ module Overloading
|
|
224
224
|
# @option user_options [Number] :xid an alias to transaction_id.
|
225
225
|
def params_only_in_overloads(user_options = {})
|
226
226
|
end
|
227
|
+
|
228
|
+
# Tests that the default signature can be present as an overload tag.
|
229
|
+
#
|
230
|
+
# @overload params_only_in_overloads()
|
231
|
+
# @example
|
232
|
+
# Hello.new
|
233
|
+
#
|
234
|
+
# @overload params_only_in_overloads(transaction_id)
|
235
|
+
# @example
|
236
|
+
# Hello.new(123)
|
237
|
+
#
|
238
|
+
# @example
|
239
|
+
# Hello.new(transaction_id: 123)
|
240
|
+
# Hello.new(xid: 123)
|
241
|
+
# @param [Hash] user_options the options to create a message with.
|
242
|
+
# @option user_options [Number] :transaction_id
|
243
|
+
# @option user_options [Number] :xid an alias to transaction_id.
|
244
|
+
def one_param_missing_in_overload(user_options = {})
|
245
|
+
end
|
227
246
|
end
|
228
247
|
|
229
248
|
module YardError
|
data/test/test_helper.rb
CHANGED
@@ -7,6 +7,16 @@ require 'bundler'
|
|
7
7
|
Bundler.require
|
8
8
|
require 'inch'
|
9
9
|
|
10
|
+
def assert_roles(object, expected, unexpected)
|
11
|
+
roles = object.roles.map(&:class)
|
12
|
+
unexpected.each do |role|
|
13
|
+
refute roles.include?(role), "Should not assign #{role}"
|
14
|
+
end
|
15
|
+
expected.each do |role|
|
16
|
+
assert roles.include?(role), "Should assign #{role}"
|
17
|
+
end
|
18
|
+
end
|
19
|
+
|
10
20
|
def fixture_path(name)
|
11
21
|
File.join(File.dirname(__FILE__), "fixtures", name.to_s)
|
12
22
|
end
|
@@ -295,14 +295,23 @@ describe ::Inch::CodeObject::Proxy::MethodObject do
|
|
295
295
|
|
296
296
|
def test_overloading_with_bad_doc
|
297
297
|
m = @objects.find("Overloading#params_only_in_overloads")
|
298
|
-
|
299
|
-
bad_roles = [
|
298
|
+
unexpected_roles = [
|
300
299
|
Inch::Evaluation::Role::Object::WithoutCodeExample,
|
301
300
|
Inch::Evaluation::Role::MethodParameter::WithoutMention,
|
302
301
|
Inch::Evaluation::Role::MethodParameter::WithoutType,
|
303
302
|
]
|
304
|
-
|
305
|
-
|
306
|
-
|
303
|
+
assert_roles m, [], unexpected_roles
|
304
|
+
end
|
305
|
+
|
306
|
+
def test_overloading_with_half_bad_doc
|
307
|
+
m = @objects.find("Overloading#one_param_missing_in_overload")
|
308
|
+
unexpected_roles = [
|
309
|
+
Inch::Evaluation::Role::Object::WithoutCodeExample,
|
310
|
+
]
|
311
|
+
expected_roles = [
|
312
|
+
Inch::Evaluation::Role::MethodParameter::WithoutMention,
|
313
|
+
Inch::Evaluation::Role::MethodParameter::WithoutType,
|
314
|
+
]
|
315
|
+
assert_roles m, expected_roles, unexpected_roles
|
307
316
|
end
|
308
317
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: inch
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.3
|
4
|
+
version: 0.4.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- René Föhring
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-04-
|
11
|
+
date: 2014-04-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -315,9 +315,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
315
315
|
version: '0'
|
316
316
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
317
317
|
requirements:
|
318
|
-
- - "
|
318
|
+
- - ">="
|
319
319
|
- !ruby/object:Gem::Version
|
320
|
-
version:
|
320
|
+
version: '0'
|
321
321
|
requirements: []
|
322
322
|
rubyforge_project:
|
323
323
|
rubygems_version: 2.2.2
|