Sha256: 1c9c74c8253a39c38adbf9b7c3256617b8a076a1d2df988a6fe240ad93b5d189

Contents?: true

Size: 922 Bytes

Versions: 4

Compression:

Stored size: 922 Bytes

Contents

Given /^a test git repo$/ do
  features_dir = File.expand_path(File.dirname(__FILE__) + '/..')
  @root_dir = File.expand_path(File.dirname(__FILE__) + '/../..')
  @tmp_git_repo_dir = File.join(features_dir, 'tmp', 'git_repo')
  if File.exists?(@tmp_git_repo_dir)
    `rm -rf #{@tmp_git_repo_dir}`
  end
  `mkdir #{@tmp_git_repo_dir}`
  `git init #{@tmp_git_repo_dir}`
end

Given /^the test git repo has a file called "([^\"]*)" containing "([^\"]*)"$/ do |filename, content|
  File.open(File.join(@tmp_git_repo_dir, filename), 'w') do |file|
    file.puts content
  end
end

Given /^a commit of all changes to the test git repo with message "([^\"]*)"$/ do |message|
  Dir.chdir(@tmp_git_repo_dir)
  `git add -A .`
  `git commit -m "#{message}"`
end

Given /^a checkout in the git repo with new branch called "([^\"]*)"$/ do |branch_name|
  Dir.chdir(@tmp_git_repo_dir)
  `git checkout -b #{branch_name} 2> /dev/null`
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
grog-0.0.3 features/step_definitions/git_steps.rb
grog-0.0.2 features/step_definitions/git_steps.rb
grog-0.0.1 features/step_definitions/git_steps.rb
grog-0.0.0 features/step_definitions/git_steps.rb