test/cli/test_cli.rb in nanoc-3.7.4 vs test/cli/test_cli.rb in nanoc-3.7.5

- old
+ new

@@ -1,9 +1,8 @@ # encoding: utf-8 class Nanoc::CLITest < Nanoc::TestCase - COMMAND_CODE = <<EOS # encoding: utf-8 usage '_test [options]' summary 'meh' @@ -117,22 +116,28 @@ 'LC_CTYPE' => 'en_US.ISO-8859-1', 'LANG' => 'en_US.ISO-8859-1', } with_env_vars(new_env_diff) do io = StringIO.new - def io.tty?; true; end + def io.tty? + true + end refute Nanoc::CLI.enable_utf8?(io) io = StringIO.new - def io.tty?; false; end + def io.tty? + false + end assert Nanoc::CLI.enable_utf8?(io) end end def test_enable_utf8 io = StringIO.new - def io.tty?; true; end + def io.tty? + true + end new_env_diff = { 'LC_ALL' => 'en_US.ISO-8859-1', 'LC_CTYPE' => 'en_US.ISO-8859-1', 'LANG' => 'en_US.ISO-8859-1', @@ -151,7 +156,6 @@ with_env_vars({ 'LC_ALL' => 'en_US.utf8' }) { assert Nanoc::CLI.enable_utf8?(io) } with_env_vars({ 'LC_CTYPE' => 'en_US.utf8' }) { assert Nanoc::CLI.enable_utf8?(io) } with_env_vars({ 'LANG' => 'en_US.utf8' }) { assert Nanoc::CLI.enable_utf8?(io) } end end - end