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/formatter.rb
|
||||||
- features/support/helpers.rb
|
- features/support/helpers.rb
|
||||||
- test/test_configuration.rb
|
- test/test_configuration.rb
|
||||||
- test/test_doctor_command.rb
|
|
||||||
- test/test_document.rb
|
- test/test_document.rb
|
||||||
- test/test_entry_filter.rb
|
- test/test_entry_filter.rb
|
||||||
- test/test_excerpt.rb
|
- test/test_excerpt.rb
|
||||||
|
|
|
@ -1,36 +1,38 @@
|
||||||
require 'helper'
|
require "helper"
|
||||||
require 'jekyll/commands/doctor'
|
require "jekyll/commands/doctor"
|
||||||
|
|
||||||
class TestDoctorCommand < JekyllUnitTest
|
class TestDoctorCommand < JekyllUnitTest
|
||||||
context 'urls only differ by case' do
|
context "urls only differ by case" do
|
||||||
setup do
|
setup do
|
||||||
clear_dest
|
clear_dest
|
||||||
end
|
end
|
||||||
|
|
||||||
should 'return success on a valid site/page' do
|
should "return success on a valid site/page" do
|
||||||
@site = Site.new(Jekyll.configuration({
|
@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
|
"destination" => dest_dir
|
||||||
}))
|
}))
|
||||||
@site.process
|
@site.process
|
||||||
output = capture_stderr do
|
output = capture_stderr do
|
||||||
ret = Jekyll::Commands::Doctor.urls_only_differ_by_case(@site)
|
ret = Jekyll::Commands::Doctor.urls_only_differ_by_case(@site)
|
||||||
assert_equal false, ret
|
assert_equal false, ret
|
||||||
end
|
end
|
||||||
assert_equal "", output
|
assert_equal "", output
|
||||||
end
|
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({
|
@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
|
"destination" => dest_dir
|
||||||
}))
|
}))
|
||||||
@site.process
|
@site.process
|
||||||
output = capture_stderr do
|
output = capture_stderr do
|
||||||
ret = Jekyll::Commands::Doctor.urls_only_differ_by_case(@site)
|
ret = Jekyll::Commands::Doctor.urls_only_differ_by_case(@site)
|
||||||
assert_equal true, ret
|
assert_equal true, ret
|
||||||
end
|
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
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue