spec/integration_spec.rb in pessimize-0.0.2 vs spec/integration_spec.rb in pessimize-0.0.3
- old
+ new
@@ -195,9 +195,108 @@
EOD
it_behaves_like "a working pessimizer", gemfile, lockfile, result
end
+ context "with a Gemfile containing a group with multiple arguments" do
+ gemfile = <<-EOD
+source "https://rubygems.org"
+gem 'json'
+gem 'rake'
+
+group :development, :test do
+ gem 'sqlite3', '>= 1.3.7'
+end
+ EOD
+
+ lockfile = <<-EOD
+GEM
+ remote: https://rubygems.org/
+ specs:
+ json (1.8.0)
+ rake (10.0.4)
+ sqlite3 (>= 1.3.7)
+ EOD
+
+ result = <<-EOD
+source "https://rubygems.org"
+
+group :development do
+ gem "sqlite3", "~> 1.3.7"
+end
+
+group :test do
+ gem "sqlite3", "~> 1.3.7"
+end
+
+gem "json", "~> 1.8.0"
+gem "rake", "~> 10.0.4"
+ EOD
+
+ it_behaves_like "a working pessimizer", gemfile, lockfile, result
+ end
+
+ context "with a Gemfile containing a group with an array argument" do
+ gemfile = <<-EOD
+source "https://rubygems.org"
+gem 'json'
+gem 'rake'
+
+group [:development, :test] do
+ gem 'sqlite3', '>= 1.3.7'
+end
+ EOD
+
+ lockfile = <<-EOD
+GEM
+ remote: https://rubygems.org/
+ specs:
+ json (1.8.0)
+ rake (10.0.4)
+ sqlite3 (>= 1.3.7)
+ EOD
+
+ result = <<-EOD
+source "https://rubygems.org"
+
+group :development do
+ gem "sqlite3", "~> 1.3.7"
+end
+
+group :test do
+ gem "sqlite3", "~> 1.3.7"
+end
+
+gem "json", "~> 1.8.0"
+gem "rake", "~> 10.0.4"
+ EOD
+
+ it_behaves_like "a working pessimizer", gemfile, lockfile, result
+ end
+
+
+ context "with a Gemfile containing multiple source statements" do
+ gemfile = <<-EOD
+source "https://rubygems.org"
+source 'https://somewhereelse.com'
+ EOD
+
+ lockfile = <<-EOD
+GEM
+ remote: https://rubygems.org/
+ specs:
+ json (1.8.0)
+ EOD
+
+ result = <<-EOD
+source "https://rubygems.org"
+source "https://somewhereelse.com"
+
+ EOD
+
+ it_behaves_like "a working pessimizer", gemfile, lockfile, result
+ end
+
context "with a Gemfile containing gems with options" do
gemfile = <<-EOD
source "https://somewhere-else.org"
gem 'metric_fu', :git => 'https://github.com/joonty/metric_fu.git', :branch => 'master'