Sha256: 25072d951c6102fba1f5c94e6e0135b1d766a4a49fbaf3e65efd98d682e958a8

Contents?: true

Size: 700 Bytes

Versions: 19

Compression:

Stored size: 700 Bytes

Contents

class Nanoc::Extra::Checking::DSLTest < Nanoc::TestCase
  def test_from_file
    with_site do |_site|
      File.open('Checks', 'w') { |io| io.write("check :foo do\n\nend\ndeploy_check :bar\n") }
      dsl = Nanoc::Extra::Checking::DSL.from_file('Checks')

      # One new check
      refute Nanoc::Extra::Checking::Check.named(:foo).nil?

      # One check marked for deployment
      assert_equal [:bar], dsl.deploy_checks
    end
  end

  def test_has_base_path
    with_site do |_site|
      File.write('stuff.rb', '$greeting = "hello"')
      File.write('Checks', 'require "./stuff"')
      Nanoc::Extra::Checking::DSL.from_file('Checks')
      assert_equal 'hello', $greeting
    end
  end
end

Version data entries

19 entries across 19 versions & 1 rubygems

Version Path
nanoc-4.3.5 test/extra/checking/test_dsl.rb
nanoc-4.3.4 test/extra/checking/test_dsl.rb
nanoc-4.3.3 test/extra/checking/test_dsl.rb
nanoc-4.3.2 test/extra/checking/test_dsl.rb
nanoc-4.3.1 test/extra/checking/test_dsl.rb
nanoc-4.3.0 test/extra/checking/test_dsl.rb
nanoc-4.2.4 test/extra/checking/test_dsl.rb
nanoc-4.2.3 test/extra/checking/test_dsl.rb
nanoc-4.2.2 test/extra/checking/test_dsl.rb
nanoc-4.2.1 test/extra/checking/test_dsl.rb
nanoc-4.2.0 test/extra/checking/test_dsl.rb
nanoc-4.1.6 test/extra/checking/test_dsl.rb
nanoc-4.2.0b1 test/extra/checking/test_dsl.rb
nanoc-4.1.5 test/extra/checking/test_dsl.rb
nanoc-4.1.4 test/extra/checking/test_dsl.rb
nanoc-4.1.3 test/extra/checking/test_dsl.rb
nanoc-4.1.2 test/extra/checking/test_dsl.rb
nanoc-4.1.1 test/extra/checking/test_dsl.rb
nanoc-4.1.0 test/extra/checking/test_dsl.rb