Sha256: 512aa1ae26f392e68cfcd17ae55fc73d8e665f0ba950115d13efb0543540927d

Contents?: true

Size: 1.09 KB

Versions: 15

Compression:

Stored size: 1.09 KB

Contents

# encoding: utf-8

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

15 entries across 15 versions & 1 rubygems

Version Path
nanoc-3.7.4 test/extra/checking/test_runner.rb
nanoc-3.7.3 test/extra/checking/test_runner.rb
nanoc-3.7.2 test/extra/checking/test_runner.rb
nanoc-3.7.1 test/extra/checking/test_runner.rb
nanoc-3.7.0 test/extra/checking/test_runner.rb
nanoc-3.6.11 test/extra/checking/test_runner.rb
nanoc-3.6.10 test/extra/checking/test_runner.rb
nanoc-3.6.9 test/extra/checking/test_runner.rb
nanoc-3.6.8 test/extra/checking/test_runner.rb
nanoc-3.6.7 test/extra/checking/test_runner.rb
nanoc-3.6.6 test/extra/checking/test_runner.rb
nanoc-3.6.5 test/extra/checking/test_runner.rb
nanoc-3.6.4 test/extra/checking/test_runner.rb
nanoc-3.6.3 test/extra/checking/test_runner.rb
nanoc-3.6.2 test/extra/checking/test_runner.rb