summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Rodríguez <deivid.rodriguez@riseup.net>2019-10-02 15:12:53 +0200
committerDavid Rodríguez <deivid.rodriguez@riseup.net>2019-10-03 16:08:40 +0200
commit938327062f06da515205fb7b158673e1f7e58d90 (patch)
tree0f62214c78fe160d909b037d36067fda1cd7353e
parent1202e8f03104b1627b4de9b833f5b56610dd6ab6 (diff)
downloadbundler-938327062f06da515205fb7b158673e1f7e58d90.tar.gz
Move `--ext` flag spec under the right context
It was under "gem naming with dashed" but this flag doesn't work this dashed gem names.
-rw-r--r--spec/commands/newgem_spec.rb68
1 files changed, 34 insertions, 34 deletions
diff --git a/spec/commands/newgem_spec.rb b/spec/commands/newgem_spec.rb
index 53bf142b76..4ca94dfd73 100644
--- a/spec/commands/newgem_spec.rb
+++ b/spec/commands/newgem_spec.rb
@@ -536,6 +536,40 @@ RSpec.describe "bundle gem" do
expect(output).to include("echo \"#{gemspec_path}\"")
end
end
+
+ context "--ext parameter set" do
+ before do
+ in_app_root
+ bundle "gem test_gem --ext"
+ end
+
+ it "builds ext skeleton" do
+ expect(bundled_app("test_gem/ext/test_gem/extconf.rb")).to exist
+ expect(bundled_app("test_gem/ext/test_gem/test_gem.h")).to exist
+ expect(bundled_app("test_gem/ext/test_gem/test_gem.c")).to exist
+ end
+
+ it "includes rake-compiler" do
+ expect(bundled_app("test_gem/Gemfile").read).to include('gem "rake-compiler"')
+ end
+
+ it "depends on compile task for build" do
+ rakefile = strip_whitespace <<-RAKEFILE
+ require "bundler/gem_tasks"
+ require "rake/extensiontask"
+
+ task :build => :compile
+
+ Rake::ExtensionTask.new("test_gem") do |ext|
+ ext.lib_dir = "lib/test_gem"
+ end
+
+ task :default => [:clobber, :compile, :spec]
+ RAKEFILE
+
+ expect(bundled_app("test_gem/Rakefile").read).to eq(rakefile)
+ end
+ end
end
context "testing --mit and --coc options against bundle config settings" do
@@ -745,40 +779,6 @@ RSpec.describe "bundle gem" do
expect(bundled_app("test-gem/test/minitest_helper.rb")).to_not exist
end
end
-
- context "--ext parameter set" do
- before do
- in_app_root
- bundle "gem test_gem --ext"
- end
-
- it "builds ext skeleton" do
- expect(bundled_app("test_gem/ext/test_gem/extconf.rb")).to exist
- expect(bundled_app("test_gem/ext/test_gem/test_gem.h")).to exist
- expect(bundled_app("test_gem/ext/test_gem/test_gem.c")).to exist
- end
-
- it "includes rake-compiler" do
- expect(bundled_app("test_gem/Gemfile").read).to include('gem "rake-compiler"')
- end
-
- it "depends on compile task for build" do
- rakefile = strip_whitespace <<-RAKEFILE
- require "bundler/gem_tasks"
- require "rake/extensiontask"
-
- task :build => :compile
-
- Rake::ExtensionTask.new("test_gem") do |ext|
- ext.lib_dir = "lib/test_gem"
- end
-
- task :default => [:clobber, :compile, :spec]
- RAKEFILE
-
- expect(bundled_app("test_gem/Rakefile").read).to eq(rakefile)
- end
- end
end
describe "uncommon gem names" do