Sha256: 620e1fa27247ebb943043eb8b49dfd6fc8372d1b4a5ee7619aa8e1d7be84fdf7

Contents?: true

Size: 1.86 KB

Versions: 4

Compression:

Stored size: 1.86 KB

Contents

Then /^git repository is clean$/ do
  assert { git.status(:porcelain => true) == '' }
end

Then /^git history has (\d+) commit(?:s)?$/ do |ncommits|
  assert { git.rev_list(:all => true).lines.count == ncommits.to_i }
end

Then /^I\'m on "(.*?)" branch$/ do |expected_branch|
  assert { git.rev_parse({:abbrev_ref => true}, 'HEAD').strip == expected_branch }
end

Then /^no other branch exists$/ do
  assert { git.branch.lines.count == 1 }
end

Then /^branch "(.*?)" exists$/ do |branch_name|
  assert { git.heads.include?(branch_name) }
end

Then /^branch "(.*?)" does not exist$/ do |branch_name|
  deny { git.heads.include?(branch_name) }
end

Then /^tag "(.*?)" exists$/ do |tag_name|
  assert { git.tags.include?(tag_name) }
end

Then /^tag "(.*?)" does not exist$/ do |tag_name|
  deny { git.tags.include?(tag_name) }
end

Then /^tag matching (#{PATTERN}) exists$/ do |pat|
  assert { git.tags.any? { |t| t =~ pat } }
end

Then /^tag matching (#{PATTERN}) does not exist$/ do |pat|
  deny { git.tags.any? { |t| t =~ pat } }
end

Then /^there's a git log message including "(.*?)"$/ do |message|
  assert { git.log.lines.any? { |ln| ln.include?(message) } }
end

Then /^there's a git commit note including "(.*?)" in "(.*?)"$/ do |value, key|
  # Not in the assert block, because it raises an exception on failure.
  contains_note = git.notes({:ref => 'vendor'}, 'list').lines.any? do |line|
    note = YAML.load git.show(line.split[0])
    (note[key] || note[key.to_sym]).to_s.include? value
  end
  assert { contains_note == true }
end

Then /^branch "(.*?)" exists in the remote repo$/ do |branch_name|
  assert { remote_git.heads.include?(branch_name) }
end

Then /^tag "(.*?)" exists in the remote repo$/ do |tag_name|
  assert { remote_git.tags.include?(tag_name) }
end

Then /^notes ref "(.*?)" exists in the remote repo$/ do |ref_name|
  assert { remote_git.note_refs.include?(ref_name) }
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
vendorificator-0.5.git.v0.4.0.63.g8e9d54d features/step_definitions/git.rb
vendorificator-0.5.git.v0.4.0.60.g9c35209 features/step_definitions/git.rb
vendorificator-0.5.git.v0.4.0.17.g26d50d8 features/step_definitions/git.rb
vendorificator-0.4.0 features/step_definitions/git.rb