Sha256: fbcf71e3fe70cd930a4fbcf1bcd980f8ee503984d30b34219c6e1fa188ef5820

Contents?: true

Size: 1.07 KB

Versions: 11

Compression:

Stored size: 1.07 KB

Contents

class Nanoc::Extra::Checking::RunnerTest < Nanoc::TestCase
  def test_run_specific
    with_site do |site|
      File.open('output/blah', 'w') { |io| io.write('I am stale! Haha!') }
      runner = Nanoc::Extra::Checking::Runner.new(site)
      runner.run_specific(%w(stale))
    end
  end

  def test_run_specific_custom
    with_site do |site|
      File.open('Checks', 'w') do |io|
        io.write('check :my_foo_check do ; puts "I AM FOO!" ; end')
      end

      runner = Nanoc::Extra::Checking::Runner.new(site)
      ios = capturing_stdio do
        runner.run_specific(%w(my_foo_check))
      end

      assert ios[:stdout].include?('I AM FOO!')
    end
  end

  def test_list_checks
    with_site do |site|
      File.open('Checks', 'w') do |io|
        io.write('check :my_foo_check do ; end')
      end

      runner = Nanoc::Extra::Checking::Runner.new(site)
      ios = capturing_stdio do
        runner.list_checks
      end

      assert ios[:stdout].include?('my_foo_check')
      assert ios[:stdout].include?('internal_links')
      assert ios[:stderr].empty?
    end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
nanoc-4.3.7 test/extra/checking/test_runner.rb
nanoc-4.3.6 test/extra/checking/test_runner.rb
nanoc-4.3.5 test/extra/checking/test_runner.rb
nanoc-4.3.4 test/extra/checking/test_runner.rb
nanoc-4.3.3 test/extra/checking/test_runner.rb
nanoc-4.3.2 test/extra/checking/test_runner.rb
nanoc-4.3.1 test/extra/checking/test_runner.rb
nanoc-4.3.0 test/extra/checking/test_runner.rb
nanoc-4.2.4 test/extra/checking/test_runner.rb
nanoc-4.2.3 test/extra/checking/test_runner.rb
nanoc-4.2.2 test/extra/checking/test_runner.rb