diff --git a/test/test_cleaner.rb b/test/test_cleaner.rb index 74e59507..fb36f59f 100644 --- a/test/test_cleaner.rb +++ b/test/test_cleaner.rb @@ -1,6 +1,6 @@ require 'helper' -class TestCleaner < Test::Unit::TestCase +class TestCleaner < Minitest::Test context "directory in keep_files" do setup do clear_dest diff --git a/test/test_coffeescript.rb b/test/test_coffeescript.rb index 49b838a1..e62fbc0c 100644 --- a/test/test_coffeescript.rb +++ b/test/test_coffeescript.rb @@ -1,6 +1,6 @@ require 'helper' -class TestCoffeeScript < Test::Unit::TestCase +class TestCoffeeScript < Minitest::Test context "converting CoffeeScript" do setup do External.require_with_graceful_fail('jekyll-coffeescript') diff --git a/test/test_collections.rb b/test/test_collections.rb index a119de5f..cdfc8ad4 100644 --- a/test/test_collections.rb +++ b/test/test_collections.rb @@ -1,6 +1,6 @@ require 'helper' -class TestCollections < Test::Unit::TestCase +class TestCollections < Minitest::Test context "an evil collection" do setup do @collection = Jekyll::Collection.new(fixture_site, "../../etc/password") @@ -114,7 +114,7 @@ class TestCollections < Test::Unit::TestCase should "create a Hash on Site with the label mapped to the instance of the Collection" do assert @site.collections.is_a?(Hash) - assert_not_nil @site.collections["methods"] + refute_nil @site.collections["methods"] assert @site.collections["methods"].is_a? Jekyll::Collection end @@ -135,16 +135,16 @@ class TestCollections < Test::Unit::TestCase end should "not include files which start with an underscore in the base collection directory" do - assert_not_include @collection.filtered_entries, "_do_not_read_me.md" + refute_include @collection.filtered_entries, "_do_not_read_me.md" end should "not include files which start with an underscore in a subdirectory" do - assert_not_include @collection.filtered_entries, "site/_dont_include_me_either.md" + refute_include @collection.filtered_entries, "site/_dont_include_me_either.md" end should "not include the underscored files in the list of docs" do - assert_not_include @collection.docs.map(&:relative_path), "_methods/_do_not_read_me.md" - assert_not_include @collection.docs.map(&:relative_path), "_methods/site/_dont_include_me_either.md" + refute_include @collection.docs.map(&:relative_path), "_methods/_do_not_read_me.md" + refute_include @collection.docs.map(&:relative_path), "_methods/site/_dont_include_me_either.md" end end @@ -178,12 +178,12 @@ class TestCollections < Test::Unit::TestCase end should "not allow symlinks" do - assert_not_include @collection.filtered_entries, "um_hi.md" - assert_not_include @collection.filtered_entries, "/um_hi.md" + refute_include @collection.filtered_entries, "um_hi.md" + refute_include @collection.filtered_entries, "/um_hi.md" end should "not include the symlinked file in the list of docs" do - assert_not_include @collection.docs.map(&:relative_path), "_methods/um_hi.md" + refute_include @collection.docs.map(&:relative_path), "_methods/um_hi.md" end end @@ -198,7 +198,7 @@ class TestCollections < Test::Unit::TestCase end should "exist" do - assert_not_nil @collection + refute_nil @collection end should "contain one document" do diff --git a/test/test_command.rb b/test/test_command.rb index 10ecccc4..3f9d06fb 100644 --- a/test/test_command.rb +++ b/test/test_command.rb @@ -1,6 +1,6 @@ require 'helper' -class TestCommand < Test::Unit::TestCase +class TestCommand < Minitest::Test context "when calling .add_build_options" do should "add common options" do cmd = Object.new @@ -13,8 +13,8 @@ class TestCommand < Test::Unit::TestCase should "exit with non-zero error code" do site = Object.new stub(site).process { raise Jekyll::Errors::FatalException } - error = assert_raise(SystemExit) { Command.process_site(site) } - assert_not_equal 0, error.status + error = assert_raises(SystemExit) { Command.process_site(site) } + refute_equal 0, error.status end end end diff --git a/test/test_configuration.rb b/test/test_configuration.rb index fffbc2db..e03cb901 100644 --- a/test/test_configuration.rb +++ b/test/test_configuration.rb @@ -1,6 +1,6 @@ require 'helper' -class TestConfiguration < Test::Unit::TestCase +class TestConfiguration < Minitest::Test context "#stringify_keys" do setup do @mixed_keys = Configuration[{ diff --git a/test/test_convertible.rb b/test/test_convertible.rb index 6482ad90..b8e809b4 100644 --- a/test/test_convertible.rb +++ b/test/test_convertible.rb @@ -1,7 +1,7 @@ require 'helper' require 'ostruct' -class TestConvertible < Test::Unit::TestCase +class TestConvertible < Minitest::Test context "yaml front-matter" do setup do @convertible = OpenStruct.new( @@ -37,7 +37,7 @@ class TestConvertible < Test::Unit::TestCase out = capture_stderr do @convertible.read_yaml(@base, 'exploit_front_matter.erb') end - assert_no_match /undefined class\/module DoesNotExist/, out + refute_match /undefined class\/module DoesNotExist/, out end should "not parse if there is encoding error in file" do diff --git a/test/test_document.rb b/test/test_document.rb index aa4e2fa9..59044a94 100644 --- a/test/test_document.rb +++ b/test/test_document.rb @@ -1,6 +1,6 @@ require 'helper' -class TestDocument < Test::Unit::TestCase +class TestDocument < Minitest::Test context "a document in a collection" do setup do @@ -283,7 +283,7 @@ class TestDocument < Test::Unit::TestCase context "without output overrides" do should "be output according to collection defaults" do - assert_not_nil @files.find { |doc| doc.relative_path == "_slides/example-slide-4.html" } + refute_nil @files.find { |doc| doc.relative_path == "_slides/example-slide-4.html" } end end diff --git a/test/test_draft.rb b/test/test_draft.rb index 5843665b..127060c1 100644 --- a/test/test_draft.rb +++ b/test/test_draft.rb @@ -1,6 +1,6 @@ require 'helper' -class TestDraft < Test::Unit::TestCase +class TestDraft < Minitest::Test def setup_draft(file) Draft.new(@site, source_dir, '', file) end diff --git a/test/test_entry_filter.rb b/test/test_entry_filter.rb index 5c5711cb..d31266b6 100644 --- a/test/test_entry_filter.rb +++ b/test/test_entry_filter.rb @@ -1,6 +1,6 @@ require 'helper' -class TestEntryFilter < Test::Unit::TestCase +class TestEntryFilter < Minitest::Test context "Filtering entries" do setup do @site = Site.new(site_configuration) @@ -71,8 +71,8 @@ class TestEntryFilter < Test::Unit::TestCase site = Site.new(site_configuration) site.read_directories("symlink-test") - assert_not_equal [], site.pages - assert_not_equal [], site.static_files + refute_equal [], site.pages + refute_equal [], site.static_files end end diff --git a/test/test_excerpt.rb b/test/test_excerpt.rb index c9a0fdc7..3ab31f91 100644 --- a/test/test_excerpt.rb +++ b/test/test_excerpt.rb @@ -1,6 +1,6 @@ require 'helper' -class TestExcerpt < Test::Unit::TestCase +class TestExcerpt < Minitest::Test def setup_post(file) Post.new(@site, source_dir, '', file) end diff --git a/test/test_filters.rb b/test/test_filters.rb index cb44b65b..65d53357 100644 --- a/test/test_filters.rb +++ b/test/test_filters.rb @@ -2,7 +2,7 @@ require 'helper' -class TestFilters < Test::Unit::TestCase +class TestFilters < Minitest::Test class JekyllFilter include Jekyll::Filters attr_accessor :site, :context diff --git a/test/test_front_matter_defaults.rb b/test/test_front_matter_defaults.rb index 2c793095..2bfd34c6 100644 --- a/test/test_front_matter_defaults.rb +++ b/test/test_front_matter_defaults.rb @@ -1,6 +1,6 @@ require 'helper' -class TestFrontMatterDefaults < Test::Unit::TestCase +class TestFrontMatterDefaults < Minitest::Test context "A site with full front matter defaults" do setup do diff --git a/test/test_generated_site.rb b/test/test_generated_site.rb index d3fbc887..40bcd8c1 100644 --- a/test/test_generated_site.rb +++ b/test/test_generated_site.rb @@ -1,6 +1,6 @@ require 'helper' -class TestGeneratedSite < Test::Unit::TestCase +class TestGeneratedSite < Minitest::Test context "generated sites" do setup do clear_dest @@ -73,7 +73,7 @@ OUTPUT end should "ensure limit posts is 0 or more" do - assert_raise ArgumentError do + assert_raises ArgumentError do clear_dest stub(Jekyll).configuration do Jekyll::Configuration::DEFAULTS.merge({'source' => source_dir, 'destination' => dest_dir, 'limit_posts' => -1}) @@ -84,7 +84,7 @@ OUTPUT end should "acceptable limit post is 0" do - assert_nothing_raised ArgumentError do + refute_raises ArgumentError do clear_dest stub(Jekyll).configuration do Jekyll::Configuration::DEFAULTS.merge({'source' => source_dir, 'destination' => dest_dir, 'limit_posts' => 0}) diff --git a/test/test_kramdown.rb b/test/test_kramdown.rb index 3998e9d3..a2954403 100644 --- a/test/test_kramdown.rb +++ b/test/test_kramdown.rb @@ -2,7 +2,7 @@ require 'helper' -class TestKramdown < Test::Unit::TestCase +class TestKramdown < Minitest::Test context "kramdown" do setup do @config = { diff --git a/test/test_layout_reader.rb b/test/test_layout_reader.rb index ff979c2b..cd658739 100644 --- a/test/test_layout_reader.rb +++ b/test/test_layout_reader.rb @@ -1,6 +1,6 @@ require 'helper' -class TestLayoutReader < Test::Unit::TestCase +class TestLayoutReader < Minitest::Test context "reading layouts" do setup do stub(Jekyll).configuration do diff --git a/test/test_liquid_extensions.rb b/test/test_liquid_extensions.rb index 2395a8de..dec13ef6 100644 --- a/test/test_liquid_extensions.rb +++ b/test/test_liquid_extensions.rb @@ -1,6 +1,6 @@ require 'helper' -class TestLiquidExtensions < Test::Unit::TestCase +class TestLiquidExtensions < Minitest::Test context "looking up a variable in a Liquid context" do class SayHi < Liquid::Tag diff --git a/test/test_log_adapter.rb b/test/test_log_adapter.rb index 71272569..ad006e1d 100644 --- a/test/test_log_adapter.rb +++ b/test/test_log_adapter.rb @@ -1,6 +1,6 @@ require 'helper' -class TestLogAdapter < Test::Unit::TestCase +class TestLogAdapter < Minitest::Test class LoggerDouble attr_accessor :level @@ -58,7 +58,7 @@ class TestLogAdapter < Test::Unit::TestCase should "call #error and abort" do logger = Jekyll::LogAdapter.new(LoggerDouble.new) stub(logger).error('topic', 'log message') { true } - assert_raise(SystemExit) { logger.abort_with('topic', 'log message') } + assert_raises(SystemExit) { logger.abort_with('topic', 'log message') } end end diff --git a/test/test_new_command.rb b/test/test_new_command.rb index 544a10c4..6fffb49f 100644 --- a/test/test_new_command.rb +++ b/test/test_new_command.rb @@ -1,7 +1,7 @@ require 'helper' require 'jekyll/commands/new' -class TestNewCommand < Test::Unit::TestCase +class TestNewCommand < Minitest::Test def dir_contents(path) Dir["#{path}/**/*"].each do |file| file.gsub! path, '' @@ -79,7 +79,7 @@ class TestNewCommand < Test::Unit::TestCase should 'force created folder' do capture_stdout { Jekyll::Commands::New.process(@args) } - assert_nothing_raised(SystemExit) do + refute_raises(SystemExit) do capture_stdout {Jekyll::Commands::New.process(@args, '--force') } end end @@ -108,7 +108,7 @@ class TestNewCommand < Test::Unit::TestCase end should 'raise an ArgumentError' do - exception = assert_raise ArgumentError do + exception = assert_raises ArgumentError do Jekyll::Commands::New.process(@empty_args) end assert_equal 'You must specify a path.', exception.message diff --git a/test/test_page.rb b/test/test_page.rb index 20ed3198..2b5fbbc0 100644 --- a/test/test_page.rb +++ b/test/test_page.rb @@ -1,6 +1,6 @@ require 'helper' -class TestPage < Test::Unit::TestCase +class TestPage < Minitest::Test def setup_page(*args) dir, file = args dir, file = ['', dir] if file.nil? diff --git a/test/test_path_sanitization.rb b/test/test_path_sanitization.rb index fa10e876..bb5a00be 100644 --- a/test/test_path_sanitization.rb +++ b/test/test_path_sanitization.rb @@ -1,6 +1,6 @@ require 'helper' -class TestPathSanitization < Test::Unit::TestCase +class TestPathSanitization < Minitest::Test context "on Windows with absolute source" do setup do @source = "C:/Users/xmr/Desktop/mpc-hc.org" diff --git a/test/test_plugin_manager.rb b/test/test_plugin_manager.rb index 0d12a254..c4a52889 100644 --- a/test/test_plugin_manager.rb +++ b/test/test_plugin_manager.rb @@ -1,6 +1,6 @@ require 'helper' -class TestPluginManager < Test::Unit::TestCase +class TestPluginManager < Minitest::Test def with_no_gemfile FileUtils.mv "Gemfile", "Gemfile.old" yield diff --git a/test/test_post.rb b/test/test_post.rb index 63684241..124f0a85 100644 --- a/test/test_post.rb +++ b/test/test_post.rb @@ -2,7 +2,7 @@ require 'helper' -class TestPost < Test::Unit::TestCase +class TestPost < Minitest::Test def setup_post(file) Post.new(@site, source_dir, '', file) end @@ -103,7 +103,7 @@ class TestPost < Test::Unit::TestCase end should "raise a good error on invalid post date" do - assert_raise Jekyll::Errors::FatalException do + assert_raises Jekyll::Errors::FatalException do @post.process("2009-27-03-foo-bar.textile") end end diff --git a/test/test_rdiscount.rb b/test/test_rdiscount.rb index da9401cf..5eade6b5 100644 --- a/test/test_rdiscount.rb +++ b/test/test_rdiscount.rb @@ -1,6 +1,6 @@ require 'helper' -class TestRdiscount < Test::Unit::TestCase +class TestRdiscount < Minitest::Test context "rdiscount" do setup do diff --git a/test/test_redcarpet.rb b/test/test_redcarpet.rb index ebf3b187..ff4585f8 100644 --- a/test/test_redcarpet.rb +++ b/test/test_redcarpet.rb @@ -1,6 +1,6 @@ require 'helper' -class TestRedcarpet < Test::Unit::TestCase +class TestRedcarpet < Minitest::Test context "redcarpet" do setup do @config = { diff --git a/test/test_regenerator.rb b/test/test_regenerator.rb index 63ac3bd0..feb5c647 100644 --- a/test/test_regenerator.rb +++ b/test/test_regenerator.rb @@ -1,6 +1,6 @@ require 'helper' -class TestRegenerator < Test::Unit::TestCase +class TestRegenerator < Minitest::Test context "The site regenerator" do setup do FileUtils.rm_rf(source_dir(".jekyll-metadata")) @@ -162,7 +162,7 @@ class TestRegenerator < Test::Unit::TestCase @regenerator.write_metadata @regenerator = Regenerator.new(@site) - assert_not_same File.mtime(@path), @regenerator.metadata[@path]["mtime"] + refute_same File.mtime(@path), @regenerator.metadata[@path]["mtime"] assert @regenerator.modified?(@path) end diff --git a/test/test_related_posts.rb b/test/test_related_posts.rb index 054ef9ae..73a8a1ca 100644 --- a/test/test_related_posts.rb +++ b/test/test_related_posts.rb @@ -1,6 +1,6 @@ require 'helper' -class TestRelatedPosts < Test::Unit::TestCase +class TestRelatedPosts < Minitest::Test context "building related posts without lsi" do setup do stub(Jekyll).configuration do diff --git a/test/test_sass.rb b/test/test_sass.rb index 50d174ba..867b2dcc 100644 --- a/test/test_sass.rb +++ b/test/test_sass.rb @@ -1,6 +1,6 @@ require 'helper' -class TestSass < Test::Unit::TestCase +class TestSass < Minitest::Test context "importing partials" do setup do @site = Jekyll::Site.new(Jekyll.configuration({ diff --git a/test/test_site.rb b/test/test_site.rb index 409392fd..a1a24e60 100644 --- a/test/test_site.rb +++ b/test/test_site.rb @@ -1,6 +1,6 @@ require 'helper' -class TestSite < Test::Unit::TestCase +class TestSite < Minitest::Test context "configuring sites" do should "have an array for plugins by default" do site = Site.new(Jekyll::Configuration::DEFAULTS) @@ -71,7 +71,7 @@ class TestSite < Test::Unit::TestCase @site = Site.new(site_configuration) @site.read @site.generate - assert_not_equal 0, @site.pages.size + refute_equal 0, @site.pages.size assert_equal 'hi', @site.file_read_opts[:secret_message] end @@ -118,7 +118,7 @@ class TestSite < Test::Unit::TestCase sleep 1 @site.process mtime3 = File.stat(dest).mtime.to_i - assert_not_equal mtime2, mtime3 # must be regenerated! + refute_equal mtime2, mtime3 # must be regenerated! sleep 1 @site.process @@ -228,13 +228,13 @@ class TestSite < Test::Unit::TestCase context 'error handling' do should "raise if destination is included in source" do - assert_raise Jekyll::Errors::FatalException do + assert_raises Jekyll::Errors::FatalException do site = Site.new(site_configuration('destination' => source_dir)) end end should "raise if destination is source" do - assert_raise Jekyll::Errors::FatalException do + assert_raises Jekyll::Errors::FatalException do site = Site.new(site_configuration('destination' => File.join(source_dir, ".."))) end end @@ -309,7 +309,7 @@ class TestSite < Test::Unit::TestCase custom_processor = "CustomMarkdown" s = Site.new(site_configuration('markdown' => custom_processor)) - assert_nothing_raised do + refute_raises do s.process end @@ -332,7 +332,7 @@ class TestSite < Test::Unit::TestCase bad_processor = "Custom::Markdown" s = Site.new(site_configuration('markdown' => bad_processor, 'full_rebuild' => true)) - assert_raise Jekyll::Errors::FatalException do + assert_raises Jekyll::Errors::FatalException do s.process end @@ -344,7 +344,7 @@ class TestSite < Test::Unit::TestCase context 'with an invalid markdown processor in the configuration' do should 'not throw an error at initialization time' do bad_processor = 'not a processor name' - assert_nothing_raised do + refute_raises do Site.new(site_configuration('markdown' => bad_processor)) end end @@ -352,7 +352,7 @@ class TestSite < Test::Unit::TestCase should 'throw FatalException at process time' do bad_processor = 'not a processor name' s = Site.new(site_configuration('markdown' => bad_processor, 'full_rebuild' => true)) - assert_raise Jekyll::Errors::FatalException do + assert_raises Jekyll::Errors::FatalException do s.process end end diff --git a/test/test_tags.rb b/test/test_tags.rb index 931c3830..883a6af6 100644 --- a/test/test_tags.rb +++ b/test/test_tags.rb @@ -2,7 +2,7 @@ require 'helper' -class TestTags < Test::Unit::TestCase +class TestTags < Minitest::Test def create_post(content, override = {}, converter_class = Jekyll::Converters::Markdown) stub(Jekyll).configuration do @@ -56,7 +56,7 @@ CONTENT assert_match r, "x.y" assert_match r, "coffee-script" - assert_no_match r, "blah^" + refute_match r, "blah^" assert_match r, "ruby key=val" assert_match r, "ruby a=b c=d" @@ -143,7 +143,7 @@ CONTENT end should "not cause a markdown error" do - assert_no_match /markdown\-html\-error/, @result + refute_match /markdown\-html\-error/, @result end should "render markdown with pygments" do @@ -410,7 +410,7 @@ CONTENT end should "not cause an error" do - assert_no_match /markdown\-html\-error/, @result + refute_match /markdown\-html\-error/, @result end should "have the url to the \"complex\" post from 2008-11-21" do @@ -434,7 +434,7 @@ CONTENT end should "not cause an error" do - assert_no_match /markdown\-html\-error/, @result + refute_match /markdown\-html\-error/, @result end should "have the url to the \"complex\" post from 2008-11-21" do @@ -458,7 +458,7 @@ title: Invalid post name linking {% post_url abc2008-11-21-complex %} CONTENT - assert_raise ArgumentError do + assert_raises ArgumentError do create_post(content, {'permalink' => 'pretty', 'source' => source_dir, 'destination' => dest_dir, 'read_posts' => true}) end end @@ -470,7 +470,7 @@ CONTENT should "not allow symlink includes" do File.open("tmp/pages-test", 'w') { |file| file.write("SYMLINK TEST") } - assert_raise IOError do + assert_raises IOError do content = < 'pretty', 'source' => source_dir, 'destination' => dest_dir, 'read_posts' => true, 'safe' => true }) end - assert_no_match /SYMLINK TEST/, @result + refute_match /SYMLINK TEST/, @result end should "not expose the existence of symlinked files" do - ex = assert_raise IOError do + ex = assert_raises IOError do content = < 'pretty', 'source' => source_dir, 'destination' => dest_dir, 'read_posts' => true}) end @@ -543,7 +543,7 @@ title: Invalid parameter syntax {% include params.html params="value %} CONTENT - assert_raise ArgumentError, 'Did not raise exception on invalid "include" syntax' do + assert_raises ArgumentError, 'Did not raise exception on invalid "include" syntax' do create_post(content, {'permalink' => 'pretty', 'source' => source_dir, 'destination' => dest_dir, 'read_posts' => true}) end end @@ -636,7 +636,7 @@ CONTENT end should "raise error relative to source directory" do - exception = assert_raise IOError do + exception = assert_raises IOError do create_post(@content, {'permalink' => 'pretty', 'source' => source_dir, 'destination' => dest_dir, 'read_posts' => true}) end assert_equal 'Included file \'_includes/missing.html\' not found', exception.message @@ -730,7 +730,7 @@ CONTENT end should "raise error relative to source directory" do - exception = assert_raise IOError do + exception = assert_raises IOError do create_post(@content, {'permalink' => 'pretty', 'source' => source_dir, 'destination' => dest_dir, 'read_posts' => true}) end assert_equal 'Included file \'./missing.html\' not found', exception.message @@ -749,7 +749,7 @@ CONTENT end should "raise error relative to source directory" do - exception = assert_raise ArgumentError do + exception = assert_raises ArgumentError do create_post(@content, {'permalink' => 'pretty', 'source' => source_dir, 'destination' => dest_dir, 'read_posts' => true}) end assert_equal "Invalid syntax for include tag. File contains invalid characters or sequences:\n\n ../README.markdown\n\nValid syntax:\n\n {% include_relative file.ext param='value' param2='value' %}\n\n", exception.message @@ -761,7 +761,7 @@ CONTENT should "not allow symlink includes" do File.open("tmp/pages-test", 'w') { |file| file.write("SYMLINK TEST") } - assert_raise IOError do + assert_raises IOError do content = < 'pretty', 'source' => source_dir, 'destination' => dest_dir, 'read_posts' => true, 'safe' => true }) end - assert_no_match /SYMLINK TEST/, @result + refute_match /SYMLINK TEST/, @result end should "not expose the existence of symlinked files" do - ex = assert_raise IOError do + ex = assert_raises IOError do content = <