Sha256: c13464ba9483e2cecfe18bdbe7cb46b4dcc7b6f7fc43e0b39e454b02e5f70b45

Contents?: true

Size: 939 Bytes

Versions: 36

Compression:

Stored size: 939 Bytes

Contents

require_relative '../test_helper'

module OhlohScm::Adapters
	class GitCommitAllTest < OhlohScm::Test

		def test_commit_all
			OhlohScm::ScratchDir.new do |dir|
				git = GitAdapter.new(:url => dir).normalize

				git.init_db
				assert !git.anything_to_commit?

				File.open(File.join(dir, 'README'), 'w') {}
				assert git.anything_to_commit?

				c = OhlohScm::Commit.new
				c.author_name = "John Q. Developer"
				c.message = "Initial checkin."
				git.commit_all(c)
				assert !git.anything_to_commit?

				assert_equal 1, git.commits.size

				assert_equal c.author_name, git.commits.first.author_name
				# Depending on version of Git used, we may or may not have trailing \n.
				# We don't really care, so just compare the stripped versions.
				assert_equal c.message.strip, git.commits.first.message.strip

				assert_equal ['.gitignore', 'README'], git.commits.first.diffs.collect { |d| d.path }.sort
			end
		end

	end
end

Version data entries

36 entries across 36 versions & 1 rubygems

Version Path
ohloh_scm-2.5.1 test/unit/git_commit_all_test.rb
ohloh_scm-2.4.14 test/unit/git_commit_all_test.rb
ohloh_scm-2.4.13 test/unit/git_commit_all_test.rb
ohloh_scm-2.4.12 test/unit/git_commit_all_test.rb
ohloh_scm-2.4.11 test/unit/git_commit_all_test.rb
ohloh_scm-2.4.10 test/unit/git_commit_all_test.rb
ohloh_scm-2.4.9 test/unit/git_commit_all_test.rb
ohloh_scm-2.4.8 test/unit/git_commit_all_test.rb
ohloh_scm-2.4.7 test/unit/git_commit_all_test.rb
ohloh_scm-2.4.6 test/unit/git_commit_all_test.rb
ohloh_scm-2.4.5 test/unit/git_commit_all_test.rb
ohloh_scm-2.4.4 test/unit/git_commit_all_test.rb
ohloh_scm-2.4.3 test/unit/git_commit_all_test.rb
ohloh_scm-2.4.1 test/unit/git_commit_all_test.rb
ohloh_scm-2.4.0 test/unit/git_commit_all_test.rb
ohloh_scm-2.3.5 test/unit/git_commit_all_test.rb
ohloh_scm-2.3.4 test/unit/git_commit_all_test.rb
ohloh_scm-2.3.2 test/unit/git_commit_all_test.rb
ohloh_scm-2.3.1 test/unit/git_commit_all_test.rb
ohloh_scm-2.3.0 test/unit/git_commit_all_test.rb