Sha256: 2b9d811025314e70e13c046c3f404ef13d8d8f8fbde9e25cd6cc1b3a3d9006cf

Contents?: true

Size: 725 Bytes

Versions: 1

Compression:

Stored size: 725 Bytes

Contents

require 'spec_helper'
require 'katapult/binary_util'

describe Katapult::BinaryUtil do

  describe '#git_commit' do
    it 'adds all files before committing' do
      allow(Katapult::BinaryUtil).to receive(:system).with(/git add --all; git commit/)
      Katapult::BinaryUtil.git_commit 'test'
    end

    it 'sets "katapult" as commit author' do
      allow(Katapult::BinaryUtil).to receive(:system).with(/git commit.*--author='katapult \<katapult@makandra\.com\>'/)
      Katapult::BinaryUtil.git_commit 'test'
    end

    it 'sanitizes the commit message' do
      allow(Katapult::BinaryUtil).to receive(:system).with(/git commit -m '"hack0r"'/)
      Katapult::BinaryUtil.git_commit "\"hack''''0r\""
    end
  end

end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
katapult-0.2.0 spec/util_spec.rb