Sha256: a9a551aca57757ebce87f85bac731a190d096bb05ef72546894ef84d483b2cbc

Contents?: true

Size: 514 Bytes

Versions: 2

Compression:

Stored size: 514 Bytes

Contents

# frozen_string_literal: true

require 'test_helper'
require 'tempfile'

module Pups
  class FileCommandTest < MiniTest::Test
    def test_simple_file_creation
      tmp = Tempfile.new('test')
      tmp.write('x')
      tmp.close

      cmd = FileCommand.new
      cmd.path = tmp.path
      cmd.contents = 'hello $world'
      cmd.params = { 'world' => 'world' }
      cmd.run

      assert_equal('hello world',
                   File.read(tmp.path))
    ensure
      tmp.close
      tmp.unlink
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
pups-1.1.1 test/file_command_test.rb
pups-1.1.0 test/file_command_test.rb