Rubocop fixes for test/test_doctor_command.rb
This commit is contained in:
parent
454a1e415c
commit
cfe6cf7ca1
|
@ -71,7 +71,6 @@ AllCops:
|
|||
- features/support/formatter.rb
|
||||
- features/support/helpers.rb
|
||||
- test/test_configuration.rb
|
||||
- test/test_doctor_command.rb
|
||||
- test/test_document.rb
|
||||
- test/test_entry_filter.rb
|
||||
- test/test_excerpt.rb
|
||||
|
|
|
@ -1,36 +1,38 @@
|
|||
require 'helper'
|
||||
require 'jekyll/commands/doctor'
|
||||
require "helper"
|
||||
require "jekyll/commands/doctor"
|
||||
|
||||
class TestDoctorCommand < JekyllUnitTest
|
||||
context 'urls only differ by case' do
|
||||
context "urls only differ by case" do
|
||||
setup do
|
||||
clear_dest
|
||||
end
|
||||
|
||||
should 'return success on a valid site/page' do
|
||||
should "return success on a valid site/page" do
|
||||
@site = Site.new(Jekyll.configuration({
|
||||
"source" => File.join(source_dir, '/_urls_differ_by_case_valid'),
|
||||
"source" => File.join(source_dir, "/_urls_differ_by_case_valid"),
|
||||
"destination" => dest_dir
|
||||
}))
|
||||
@site.process
|
||||
output = capture_stderr do
|
||||
ret = Jekyll::Commands::Doctor.urls_only_differ_by_case(@site)
|
||||
assert_equal false, ret
|
||||
ret = Jekyll::Commands::Doctor.urls_only_differ_by_case(@site)
|
||||
assert_equal false, ret
|
||||
end
|
||||
assert_equal "", output
|
||||
end
|
||||
|
||||
should 'return warning for pages only differing by case' do
|
||||
should "return warning for pages only differing by case" do
|
||||
@site = Site.new(Jekyll.configuration({
|
||||
"source" => File.join(source_dir, '/_urls_differ_by_case_invalid'),
|
||||
"source" => File.join(source_dir, "/_urls_differ_by_case_invalid"),
|
||||
"destination" => dest_dir
|
||||
}))
|
||||
@site.process
|
||||
output = capture_stderr do
|
||||
ret = Jekyll::Commands::Doctor.urls_only_differ_by_case(@site)
|
||||
assert_equal true, ret
|
||||
ret = Jekyll::Commands::Doctor.urls_only_differ_by_case(@site)
|
||||
assert_equal true, ret
|
||||
end
|
||||
assert_includes output, "Warning: The following URLs only differ by case. On a case-insensitive file system one of the URLs will be overwritten by the other: #{dest_dir}/about/index.html, #{dest_dir}/About/index.html"
|
||||
assert_includes output, "Warning: The following URLs only differ by case. "\
|
||||
"On a case-insensitive file system one of the URLs will be overwritten by the "\
|
||||
"other: #{dest_dir}/about/index.html, #{dest_dir}/About/index.html"
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue