summaryrefslogtreecommitdiff
path: root/spec/support/matchers.rb
diff options
context:
space:
mode:
authorSamuel Giddins <segiddins@segiddins.me>2016-01-10 00:12:06 -0600
committerSamuel Giddins <segiddins@segiddins.me>2016-01-25 10:49:51 -0600
commit32595930a639549cbf6aa523ee831a3d51209150 (patch)
treeadc4d6585782e8c51ac1e861f05006d355261bf3 /spec/support/matchers.rb
parentc19c34a5404322816610562b1e7f5541329558e2 (diff)
downloadbundler-32595930a639549cbf6aa523ee831a3d51209150.tar.gz
Add bang versions of the spec helpers
Diffstat (limited to 'spec/support/matchers.rb')
-rw-r--r--spec/support/matchers.rb7
1 files changed, 4 insertions, 3 deletions
diff --git a/spec/support/matchers.rb b/spec/support/matchers.rb
index 6c585ddae4..58babf2ceb 100644
--- a/spec/support/matchers.rb
+++ b/spec/support/matchers.rb
@@ -31,8 +31,9 @@ module Spec
names.each do |name|
name, version, platform = name.split(/\s+/)
version_const = name == "bundler" ? "Bundler::VERSION" : Spec::Builders.constantize(name)
- run "require '#{name}.rb'; puts #{version_const}", *groups
- actual_version, actual_platform = out.split(/\s+/)
+ run! "require '#{name}.rb'; puts #{version_const}", *groups
+ expect(out).not_to be_empty, "#{name} is not installed"
+ actual_version, actual_platform = out.split(/\s+/, 2)
expect(Gem::Version.new(actual_version)).to eq(Gem::Version.new(version))
expect(actual_platform).to eq(platform)
end
@@ -44,7 +45,7 @@ module Spec
opts = names.last.is_a?(Hash) ? names.pop : {}
groups = Array(opts[:groups]) || []
names.each do |name|
- name, version = name.split(/\s+/)
+ name, version = name.split(/\s+/, 2)
run <<-R, *(groups + [opts])
begin
require '#{name}'