spec/unit/yardcheck/runner_spec.rb in yardcheck-0.0.2 vs spec/unit/yardcheck/runner_spec.rb in yardcheck-0.0.3
- old
+ new
@@ -23,30 +23,32 @@
scope: :instance,
selector: :add,
namespace: TestApp::Namespace,
params: { left: 'foo', right: 3 },
return_value: 5,
- example_location: 'test_app_spec.rb:1'
+ example_metadata: { location: 'test_app_spec.rb:1', id: 'test_app_spec.rb[1:1]' }
),
Yardcheck::MethodCall::Return.process(
scope: :class,
selector: :add,
namespace: TestApp::Namespace.singleton_class,
params: { left: 2, right: 3 },
return_value: 5,
- example_location: 'test_app_spec.rb:2'
+ example_metadata: { location: 'test_app_spec.rb:2', id: 'test_app_spec.rb[1:2]' }
)
]
end
let(:output) do
<<~MSG
- Expected #<Class:TestApp::Namespace>#add to return String but observed Fixnum
+ Expected #<Class:TestApp::Namespace>#add to return String but observed Integer
source: ./test_app/lib/test_app.rb:15
tests:
- test_app_spec.rb:2
+ rerun with:
+ rspec 'test_app_spec.rb[1:2]'
# Singleton method with correct param definition and incorrect return
#
# @param left [Integer]
# @param right [Integer]
@@ -59,10 +61,12 @@
Expected TestApp::Namespace#add to receive Integer for left but observed String
source: ./test_app/lib/test_app.rb:25
tests:
- test_app_spec.rb:1
+ rerun with:
+ rspec 'test_app_spec.rb[1:1]'
# Instance method with correct param definition and incorrect return
#
# @param left [Integer]
# @param right [Integer]
@@ -70,15 +74,17 @@
# @return [String]
def add(left, right)
left + right
end
- Expected TestApp::Namespace#add to return String but observed Fixnum
+ Expected TestApp::Namespace#add to return String but observed Integer
source: ./test_app/lib/test_app.rb:25
tests:
- test_app_spec.rb:1
+ rerun with:
+ rspec 'test_app_spec.rb[1:1]'
# Instance method with correct param definition and incorrect return
#
# @param left [Integer]
# @param right [Integer]
@@ -116,27 +122,27 @@
scope: :instance,
selector: :add,
namespace: TestApp::Namespace,
params: { left: 'foo', right: 3 },
return_value: 'valid return type',
- example_location: 'test_app_spec.rb:1'
+ example_metadata: { location: 'test_app_spec.rb:1', id: 'test_app_spec.rb[1:1]' }
),
Yardcheck::MethodCall::Return.process(
scope: :instance,
selector: :add,
namespace: TestApp::Namespace,
params: { left: 'foo', right: 3 },
return_value: 'valid return type',
- example_location: 'test_app_spec.rb:2'
+ example_metadata: { location: 'test_app_spec.rb:2', id: 'test_app_spec.rb[1:2]' }
),
Yardcheck::MethodCall::Return.process(
scope: :instance,
selector: :add,
namespace: TestApp::Namespace,
params: { left: 1, right: 'now this one is wrong' },
return_value: 'valid return type',
- example_location: 'test_app_spec.rb:3'
+ example_metadata: { location: 'test_app_spec.rb:3', id: 'test_app_spec.rb[1:3]' }
)
]
end
let(:output) do
@@ -145,10 +151,12 @@
source: ./test_app/lib/test_app.rb:25
tests:
- test_app_spec.rb:1
- test_app_spec.rb:2
+ rerun with:
+ rspec 'test_app_spec.rb[1:1]' 'test_app_spec.rb[1:2]'
# Instance method with correct param definition and incorrect return
#
# @param left [Integer]
# @param right [Integer]
@@ -161,9 +169,11 @@
Expected TestApp::Namespace#add to receive Integer for right but observed String
source: ./test_app/lib/test_app.rb:25
tests:
- test_app_spec.rb:3
+ rerun with:
+ rspec 'test_app_spec.rb[1:3]'
# Instance method with correct param definition and incorrect return
#
# @param left [Integer]
# @param right [Integer]