提交 ec1b7f42 编写于 作者: M Mislav Marohnić 提交者: Mislav Marohnić

bump aruba

上级 75a7583d
source 'https://rubygems.org' source 'https://rubygems.org'
gem 'aruba', '~> 1.0.0.pre.alpha.4' gem 'aruba', '~> 1.0.4'
gem 'cucumber', '~> 3.1.2' gem 'cucumber', '~> 3.1.2'
gem 'sinatra' gem 'sinatra'
GEM GEM
remote: https://rubygems.org/ remote: https://rubygems.org/
specs: specs:
aruba (1.0.0.pre.alpha.4) aruba (1.0.4)
childprocess (~> 1.0) childprocess (>= 2.0, < 5.0)
contracts (~> 0.13) contracts (~> 0.16.0)
cucumber (>= 2.4, < 4.0) cucumber (>= 2.4, < 6.0)
ffi (~> 1.9)
rspec-expectations (~> 3.4) rspec-expectations (~> 3.4)
thor (~> 0.19) thor (~> 1.0)
backports (3.15.0) backports (3.23.0)
builder (3.2.3) builder (3.2.4)
childprocess (1.0.1) childprocess (4.1.0)
rake (< 13.0) contracts (0.16.1)
contracts (0.16.0)
cucumber (3.1.2) cucumber (3.1.2)
builder (>= 2.1.2) builder (>= 2.1.2)
cucumber-core (~> 3.2.0) cucumber-core (~> 3.2.0)
...@@ -29,27 +27,24 @@ GEM ...@@ -29,27 +27,24 @@ GEM
cucumber-expressions (6.0.1) cucumber-expressions (6.0.1)
cucumber-tag_expressions (1.1.1) cucumber-tag_expressions (1.1.1)
cucumber-wire (0.0.1) cucumber-wire (0.0.1)
diff-lcs (1.3) diff-lcs (1.5.0)
ffi (1.11.1)
ffi (1.11.1-java)
gherkin (5.1.0) gherkin (5.1.0)
multi_json (1.13.1) multi_json (1.15.0)
multi_test (0.1.2) multi_test (0.1.2)
mustermann (1.0.3) mustermann (1.0.3)
rack (2.0.7) rack (2.0.7)
rack-protection (2.0.5) rack-protection (2.0.5)
rack rack
rake (12.3.3) rspec-expectations (3.11.0)
rspec-expectations (3.8.4)
diff-lcs (>= 1.2.0, < 2.0) diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.8.0) rspec-support (~> 3.11.0)
rspec-support (3.8.2) rspec-support (3.11.0)
sinatra (2.0.5) sinatra (2.0.5)
mustermann (~> 1.0) mustermann (~> 1.0)
rack (~> 2.0) rack (~> 2.0)
rack-protection (= 2.0.5) rack-protection (= 2.0.5)
tilt (~> 2.0) tilt (~> 2.0)
thor (0.20.3) thor (1.2.1)
tilt (2.0.9) tilt (2.0.9)
PLATFORMS PLATFORMS
...@@ -57,9 +52,9 @@ PLATFORMS ...@@ -57,9 +52,9 @@ PLATFORMS
ruby ruby
DEPENDENCIES DEPENDENCIES
aruba (~> 1.0.0.pre.alpha.4) aruba (~> 1.0.4)
cucumber (~> 3.1.2) cucumber (~> 3.1.2)
sinatra sinatra
BUNDLED WITH BUNDLED WITH
1.17.1 1.17.2
require 'fileutils' require 'fileutils'
Given(/^HTTPS is preferred$/) do Given(/^HTTPS is preferred$/) do
run_command_and_stop %(git config --global hub.protocol https) run_ignored_command %(git config --global hub.protocol https)
end end
Given(/^there are no remotes$/) do Given(/^there are no remotes$/) do
run_command_and_stop 'git remote' output = run_ignored_command 'git remote'
expect(last_command_started).not_to have_output expect(output).to be_empty
end end
Given(/^"([^"]*)" is a whitelisted Enterprise host$/) do |host| Given(/^"([^"]*)" is a whitelisted Enterprise host$/) do |host|
run_command_and_stop %(git config --global --add hub.host "#{host}") run_ignored_command %(git config --global --add hub.host "#{host}")
end end
Given(/^git "(.+?)" is set to "(.+?)"$/) do |key, value| Given(/^git "(.+?)" is set to "(.+?)"$/) do |key, value|
run_command_and_stop %(git config #{key} "#{value}") run_ignored_command %(git config #{key} "#{value}")
end end
Given(/^the "([^"]*)" remote has(?: (push))? url "([^"]*)"$/) do |remote_name, push, url| Given(/^the "([^"]*)" remote has(?: (push))? url "([^"]*)"$/) do |remote_name, push, url|
run_command_and_stop 'git remote' remotes = run_ignored_command 'git remote'
unless last_command_started.stdout.split("\n").include? remote_name unless remotes.split("\n").include? remote_name
run_command_and_stop %(git remote add #{remote_name} "#{url}") run_ignored_command %(git remote add #{remote_name} "#{url}")
else else
run_command_and_stop %(git remote set-url #{"--push" if push} #{remote_name} "#{url}") run_ignored_command %(git remote set-url #{"--push" if push} #{remote_name} "#{url}")
end end
end end
...@@ -52,7 +52,7 @@ Given(/^I am in "([^"]*)" git repo$/) do |dir_name| ...@@ -52,7 +52,7 @@ Given(/^I am in "([^"]*)" git repo$/) do |dir_name|
end end
Given(/^a (bare )?git repo in "([^"]*)"$/) do |bare, dir_name| Given(/^a (bare )?git repo in "([^"]*)"$/) do |bare, dir_name|
run_command_and_stop %(git init --quiet #{"--bare" if bare} '#{dir_name}') run_ignored_command %(git init --quiet #{"--bare" if bare} '#{dir_name}')
end end
Given(/^a git bundle named "([^"]*)"$/) do |file| Given(/^a git bundle named "([^"]*)"$/) do |file|
...@@ -71,8 +71,8 @@ end ...@@ -71,8 +71,8 @@ end
Given(/^there is a commit named "([^"]+)"$/) do |name| Given(/^there is a commit named "([^"]+)"$/) do |name|
empty_commit empty_commit
empty_commit empty_commit
run_command_and_stop %(git tag #{name}) run_ignored_command %(git tag #{name})
run_command_and_stop %(git reset --quiet --hard HEAD^) run_ignored_command %(git reset --quiet --hard HEAD^)
end end
Given(/^there is a git FETCH_HEAD$/) do Given(/^there is a git FETCH_HEAD$/) do
...@@ -83,7 +83,7 @@ Given(/^there is a git FETCH_HEAD$/) do ...@@ -83,7 +83,7 @@ Given(/^there is a git FETCH_HEAD$/) do
fetch_head.puts "%s\t\t'refs/heads/made-up' of git://github.com/made/up.git" % `git rev-parse HEAD`.chomp fetch_head.puts "%s\t\t'refs/heads/made-up' of git://github.com/made/up.git" % `git rev-parse HEAD`.chomp
end end
end end
run_command_and_stop %(git reset --quiet --hard HEAD^) run_ignored_command %(git reset --quiet --hard HEAD^)
end end
When(/^I make (a|\d+) commits?(?: with message "([^"]+)")?$/) do |num, msg| When(/^I make (a|\d+) commits?(?: with message "([^"]+)")?$/) do |num, msg|
...@@ -114,15 +114,15 @@ Given(/^the "([^"]+)" branch is pushed to "([^"]+)"$/) do |name, upstream| ...@@ -114,15 +114,15 @@ Given(/^the "([^"]+)" branch is pushed to "([^"]+)"$/) do |name, upstream|
end end
Given(/^I am on the "([^"]+)" branch(?: (pushed to|with upstream) "([^"]+)")?$/) do |name, type, upstream| Given(/^I am on the "([^"]+)" branch(?: (pushed to|with upstream) "([^"]+)")?$/) do |name, type, upstream|
run_command_and_stop %(git checkout --quiet -b #{shell_escape name}) run_ignored_command %(git checkout --quiet -b #{shell_escape name})
empty_commit empty_commit
if upstream if upstream
full_upstream = upstream.start_with?('refs/') ? upstream : "refs/remotes/#{upstream}" full_upstream = upstream.start_with?('refs/') ? upstream : "refs/remotes/#{upstream}"
run_command_and_stop %(git update-ref #{shell_escape full_upstream} HEAD) run_ignored_command %(git update-ref #{shell_escape full_upstream} HEAD)
if type == 'with upstream' if type == 'with upstream'
run_command_and_stop %(git branch --set-upstream-to #{shell_escape upstream}) run_ignored_command %(git branch --set-upstream-to #{shell_escape upstream})
end end
end end
end end
...@@ -136,13 +136,13 @@ Given(/^the default branch for "([^"]+)" is "([^"]+)"$/) do |remote, branch| ...@@ -136,13 +136,13 @@ Given(/^the default branch for "([^"]+)" is "([^"]+)"$/) do |remote, branch|
FileUtils.cp '.git/refs/heads/master', ref_file FileUtils.cp '.git/refs/heads/master', ref_file
end end
end end
run_command_and_stop %(git remote set-head #{remote} #{branch}) run_ignored_command %(git remote set-head #{remote} #{branch})
end end
Given(/^I am in detached HEAD$/) do Given(/^I am in detached HEAD$/) do
empty_commit empty_commit
empty_commit empty_commit
run_command_and_stop %(git checkout HEAD^) run_ignored_command %(git checkout HEAD^)
end end
Given(/^the current dir is not a repo$/) do Given(/^the current dir is not a repo$/) do
...@@ -185,26 +185,26 @@ Then(/^the git command should be unchanged$/) do ...@@ -185,26 +185,26 @@ Then(/^the git command should be unchanged$/) do
end end
Then(/^the url for "([^"]*)" should be "([^"]*)"$/) do |name, url| Then(/^the url for "([^"]*)" should be "([^"]*)"$/) do |name, url|
run_command_and_stop %(git config --get-all remote.#{name}.url) output = run_ignored_command %(git config --get-all remote.#{name}.url)
expect(last_command_started).to have_output(url) expect(output).to include(url)
end end
Then(/^the "([^"]*)" submodule url should be "([^"]*)"$/) do |name, url| Then(/^the "([^"]*)" submodule url should be "([^"]*)"$/) do |name, url|
run_command_and_stop %(git config --get-all submodule."#{name}".url) output = run_ignored_command %(git config --get-all submodule."#{name}".url)
expect(last_command_started).to have_output(url) expect(output).to include(url)
end end
Then(/^"([^"]*)" should merge "([^"]*)" from remote "([^"]*)"$/) do |name, merge, remote| Then(/^"([^"]*)" should merge "([^"]*)" from remote "([^"]*)"$/) do |name, merge, remote|
run_command_and_stop %(git config --get-all branch.#{name}.remote) output = run_ignored_command %(git config --get-all branch.#{name}.remote)
expect(last_command_started).to have_output(remote) expect(output).to include(remote)
run_command_and_stop %(git config --get-all branch.#{name}.merge) output = run_ignored_command %(git config --get-all branch.#{name}.merge)
expect(last_command_started).to have_output(merge) expect(output).to include(merge)
end end
Then(/^there should be no "([^"]*)" remote$/) do |remote_name| Then(/^there should be no "([^"]*)" remote$/) do |remote_name|
run_command_and_stop 'git remote' remotes = run_ignored_command 'git remote'
expect(last_command_started.output.split("\n")).to_not include(remote_name) expect(remotes.split("\n")).to_not include(remote_name)
end end
Then(/^the file "([^"]*)" should have mode "([^"]*)"$/) do |file, expected_mode| Then(/^the file "([^"]*)" should have mode "([^"]*)"$/) do |file, expected_mode|
...@@ -216,8 +216,8 @@ Given(/^the remote commit states of "(.*?)" "(.*?)" are:$/) do |proj, ref, json_ ...@@ -216,8 +216,8 @@ Given(/^the remote commit states of "(.*?)" "(.*?)" are:$/) do |proj, ref, json_
if ref == 'HEAD' if ref == 'HEAD'
empty_commit empty_commit
end end
run_command_and_stop %(git rev-parse #{ref}) output = run_ignored_command %(git rev-parse #{ref})
rev = last_command_started.output.chomp rev = output.chomp
host, owner, repo = proj.split('/', 3) host, owner, repo = proj.split('/', 3)
if repo.nil? if repo.nil?
......
...@@ -2,6 +2,7 @@ require 'aruba/cucumber' ...@@ -2,6 +2,7 @@ require 'aruba/cucumber'
require 'fileutils' require 'fileutils'
require 'forwardable' require 'forwardable'
require 'tmpdir' require 'tmpdir'
require 'open3'
system_git = `which git 2>/dev/null`.chomp system_git = `which git 2>/dev/null`.chomp
bin_dir = File.expand_path('../fakebin', __FILE__) bin_dir = File.expand_path('../fakebin', __FILE__)
...@@ -139,10 +140,17 @@ World Module.new { ...@@ -139,10 +140,17 @@ World Module.new {
@empty_commit_count = defined?(@empty_commit_count) ? @empty_commit_count + 1 : 1 @empty_commit_count = defined?(@empty_commit_count) ? @empty_commit_count + 1 : 1
message = "empty #{@empty_commit_count}" message = "empty #{@empty_commit_count}"
end end
run_command_and_stop "git commit --quiet -m '#{message}' --allow-empty" run_ignored_command "git commit --quiet -m '#{message}' --allow-empty"
end end
def shell_escape(message) def shell_escape(message)
message.to_s.gsub(/['"\\ $]/) { |m| "\\#{m}" } message.to_s.gsub(/['"\\ $]/) { |m| "\\#{m}" }
end end
# runs a command entirely outside of Aruba's command system and returns its stdout
def run_ignored_command(cmd_string)
stdout, stderr, status = Open3.capture3(aruba.environment, cmd_string, chdir: expand_path('.'))
expect(status).to be_success
stdout
end
} }
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册