1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00
ruby--ruby/spec/bundler/runtime/gem_tasks_spec.rb
hsbt be7b592912 Update bundled bundler to 1.16.0.
* lib/bundler, spec/bundler: Merge bundler-1.16.0.
  * common.mk: rspec examples of bundler-1.16.0 needs require option.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60603 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-11-01 23:29:38 +00:00

42 lines
1 KiB
Ruby

# frozen_string_literal: true
RSpec.describe "require 'bundler/gem_tasks'" do
before :each do
bundled_app("foo.gemspec").open("w") do |f|
f.write <<-GEMSPEC
Gem::Specification.new do |s|
s.name = "foo"
end
GEMSPEC
end
bundled_app("Rakefile").open("w") do |f|
f.write <<-RAKEFILE
$:.unshift("#{bundler_path}")
require "bundler/gem_tasks"
RAKEFILE
end
end
it "includes the relevant tasks" do
with_gem_path_as(Spec::Path.base_system_gems.to_s) do
sys_exec "#{rake} -T"
end
expect(err).to eq("")
expected_tasks = [
"rake build",
"rake clean",
"rake clobber",
"rake install",
"rake release[remote]",
]
tasks = out.lines.to_a.map {|s| s.split("#").first.strip }
expect(tasks & expected_tasks).to eq(expected_tasks)
expect(exitstatus).to eq(0) if exitstatus
end
it "adds 'pkg' to rake/clean's CLOBBER" do
require "bundler/gem_tasks"
expect(CLOBBER).to include("pkg")
end
end