test/integration/cli/command/suggest_test.rb in inch-0.5.0.rc3 vs test/integration/cli/command/suggest_test.rb in inch-0.5.0.rc4

- old
+ new

@@ -1,21 +1,21 @@ -require File.expand_path(File.dirname(__FILE__) + '/../../../test_helper') +require File.expand_path(File.dirname(__FILE__) + "/../../../test_helper") describe ::Inch::CLI::Command::Suggest do before do - Dir.chdir fixture_path(:simple) + Dir.chdir fixture_path(:ruby, :simple) @command = ::Inch::CLI::Command::Suggest end it "should run without args" do out, err = capture_io do - @command.run() + @command.run end refute out.empty?, "there should be some output" assert err.empty?, "there should be no errors" assert_match /\bFoo::Bar#method_with_wrong_doc\b/, out - assert_match /\bFoo::Bar#method_without_docstring\b/, out + assert_match /\bFoo::Bar#method_with_rdoc_doc\b/, out assert_match /\bFoo::Bar#method_with_unstructured_doc\b/, out end it "should run with --pedantic switch" do out, err = capture_io do @@ -30,37 +30,37 @@ @command.run("lib/**/*.rb", "app/**/*.rb") end refute out.empty?, "there should be some output" assert err.empty?, "there should be no errors" assert_match /\bFoo::Bar#method_with_wrong_doc\b/, out - assert_match /\bFoo::Bar#method_without_docstring\b/, out + assert_match /\bFoo::Bar#method_with_rdoc_doc\b/, out assert_match /\bFoo::Bar#method_with_unstructured_doc\b/, out end it "should run with non-existing filelist in args" do - out, err = capture_io do + _out, _err = capture_io do @command.run("app/**/*.rb") end # TODO: not sure what should actually happen here: # no output or error message? - #assert out.empty?, "there should be no output" - #assert err.empty?, "there should be no errors" + # assert out.empty?, "there should be no output" + # assert err.empty?, "there should be no errors" end it "should run with --objects switch" do out, err = capture_io do @command.run("lib/**/*.rb", "app/**/*.rb", "--objects=30") end refute out.empty?, "there should be some output" assert err.empty?, "there should be no errors" assert_match /\bFoo::Bar#method_with_wrong_doc\b/, out - assert_match /\bFoo::Bar#method_without_docstring\b/, out + assert_match /\bFoo::Bar#method_with_rdoc_doc\b/, out assert_match /\bFoo::Bar#method_with_unstructured_doc\b/, out end it "should give error when run with --unknown-switch" do - out, err = capture_io do + _out, _err = capture_io do assert_raises(SystemExit) { @command.run("--unknown-switch") } end end it "should output info when run with --help" do @@ -83,19 +83,19 @@ # Edge case: Really good codebase it "should run without args on really good fixture" do out, err = capture_io do - Dir.chdir fixture_path(:really_good) - @command.run() + Dir.chdir fixture_path(:ruby, :really_good) + @command.run end refute out.empty?, "there should be some output" assert err.empty?, "there should be no errors" end it "should run with --pedantic switch" do out, err = capture_io do - Dir.chdir fixture_path(:really_good) + Dir.chdir fixture_path(:ruby, :really_good) @command.run("--pedantic") end refute out.empty?, "there should be some output" assert err.empty?, "there should be no errors" end