Sha256: c048346a7ccfc4022ff6eb9f4c129d2935445a1d1f2e2dc034a960ffab26a97f
Contents?: true
Size: 923 Bytes
Versions: 18
Compression:
Stored size: 923 Bytes
Contents
# frozen_string_literal: true require 'helper' class Nanoc::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::Checking::DSL.from_file('Checks') # One new check refute Nanoc::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::Checking::DSL.from_file('Checks') assert_equal 'hello', $greeting end end def test_has_absolute_path with_site do |_site| File.write('Checks', '$stuff = __FILE__') Nanoc::Checking::DSL.from_file('Checks') assert($stuff.start_with?('/')) end end end
Version data entries
18 entries across 18 versions & 1 rubygems