Sha256: e3aa1d3346102c8fc9313657910bb29b2ad462ac2eb435e79042a62604e65700

Contents?: true

Size: 1.04 KB

Versions: 7

Compression:

Stored size: 1.04 KB

Contents

class Nanoc::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::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::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::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

7 entries across 7 versions & 1 rubygems

Version Path
nanoc-4.4.5 test/checking/test_runner.rb
nanoc-4.4.4 test/checking/test_runner.rb
nanoc-4.4.3 test/checking/test_runner.rb
nanoc-4.4.2 test/checking/test_runner.rb
nanoc-4.4.1 test/checking/test_runner.rb
nanoc-4.4.0 test/checking/test_runner.rb
nanoc-4.3.8 test/checking/test_runner.rb