spec/integration/yardcheck_spec.rb in yardcheck-0.0.1 vs spec/integration/yardcheck_spec.rb in yardcheck-0.0.2
- old
+ new
@@ -31,13 +31,15 @@
def remove_color(string)
string.gsub(/\e\[(?:1\;)?\d+m/, '')
end
it 'generates a warning for invalid constant' do
- expect_report('WARNING: Unabled to resolve "What" for lib/test_app.rb:37')
- expect_report('WARNING: Unabled to resolve "Wow" for lib/test_app.rb:37')
- expect_report('WARNING: Unabled to resolve :foo for lib/test_app.rb:109')
+ expect_report('WARNING: Unabled to resolve "What" for lib/test_app.rb:43')
+ expect_report('WARNING: Unabled to resolve "Wow" for lib/test_app.rb:43')
+ expect_report('WARNING: Unabled to resolve (Unspecified type) for lib/test_app.rb:58')
+ expect_report('WARNING: Unabled to resolve (Unspecified type) for lib/test_app.rb:58')
+ expect_report('WARNING: Unabled to resolve :foo for lib/test_app.rb:122')
end
it 'reports expectations' do
aggregate_failures do
expect_report('Expected TestApp::Namespace#add to return String but observed Fixnum')
@@ -47,9 +49,13 @@
'to return TestApp::Namespace::Child but observed String'
)
expect_report(
'Expected TestApp::Namespace#improperly_tested_with_instance_double ' \
'to receive String for value but observed Integer'
+ )
+ expect_report(
+ 'Expected TestApp::Namespace#invalid_raise_documentation to raise ' \
+ 'TestApp::Namespace::AppError but observed KeyError'
)
matches = report.scan(/^Expected .+ to return .+ but observed .+$/)
expect(matches.size).to be(3)
end
end