Sha256: 57ab775c45bccd9de5c66ea30e54bf2e9dfacd5341b833108a1e58383316affa

Contents?: true

Size: 836 Bytes

Versions: 14

Compression:

Stored size: 836 Bytes

Contents

class Nanoc::CLI::Commands::SyncTest < Nanoc::TestCase

  def test_run
    with_site do
      File.open('lib/foo_data_source.rb', 'w') do |io|
        io.write "class FooDataSource < Nanoc::DataSource\n"
        io.write "  identifier :sync_test_foo\n"
        io.write "  def sync\n"
        io.write "    File.open('foo_source_data.yaml', 'w') do |io|\n"
        io.write "      io.write 'sync: true'\n"
        io.write "    end\n"
        io.write "  end\n"
        io.write "end\n"
      end

      File.open('nanoc.yaml', 'w') do |io|
        io.write "data_sources:\n"
        io.write "  - type: sync_test_foo\n"
        io.write "    items_root: /"
      end

      Nanoc::CLI.run %w( sync )

      assert File.file?('foo_source_data.yaml')
      assert_equal File.read('foo_source_data.yaml'), 'sync: true'
    end
  end

end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
nanoc-3.7.3 test/cli/commands/test_sync.rb
nanoc-3.7.2 test/cli/commands/test_sync.rb
nanoc-3.7.1 test/cli/commands/test_sync.rb
nanoc-3.7.0 test/cli/commands/test_sync.rb
nanoc-3.6.11 test/cli/commands/test_sync.rb
nanoc-3.6.10 test/cli/commands/test_sync.rb
nanoc-3.6.9 test/cli/commands/test_sync.rb
nanoc-3.6.8 test/cli/commands/test_sync.rb
nanoc-3.6.7 test/cli/commands/test_sync.rb
nanoc-3.6.6 test/cli/commands/test_sync.rb
nanoc-3.6.5 test/cli/commands/test_sync.rb
nanoc-3.6.4 test/cli/commands/test_sync.rb
nanoc-3.6.3 test/cli/commands/test_sync.rb
nanoc-3.6.2 test/cli/commands/test_sync.rb