require_relative "test_helper"
require "tmpdir"
require "fileutils"

class InspectorTest < Minitest::Test
  def test_detects_docs_issues_dir
    Dir.mktmpdir do |dir|
      FileUtils.mkdir_p(File.join(dir, "docs/issues"))
      assert_includes Backlog::Inspector.issue_files(dir), "docs/issues"
    end
  end

  def test_detects_issues_md_file
    Dir.mktmpdir do |dir|
      File.write(File.join(dir, "ISSUES.md"), "# issues\n")
      assert_includes Backlog::Inspector.issue_files(dir), "ISSUES.md"
    end
  end

  def test_returns_empty_when_nothing_present
    Dir.mktmpdir do |dir|
      assert_empty Backlog::Inspector.issue_files(dir)
    end
  end
end
