aboutsummaryrefslogtreecommitdiffstats
path: root/spec/lock
diff options
context:
space:
mode:
authorAndre Arko <andre@arko.net>2010-11-02 12:38:34 -0700
committerAndre Arko <andre@arko.net>2010-11-02 12:38:34 -0700
commit93b8f6e897afda618b846da5daecc9a244a07cb5 (patch)
tree107a54f8bef371962ba27ed02e7343de485427d6 /spec/lock
parentdc46ae439a3f2f7ac842c2854b348c79634f67d7 (diff)
downloadbundler-93b8f6e897afda618b846da5daecc9a244a07cb5.tar.gz
Clean up line ending preservation, refactor and relocate specs
Diffstat (limited to 'spec/lock')
-rw-r--r--spec/lock/lockfile_spec.rb (renamed from spec/lock/flex_spec.rb)33
1 files changed, 33 insertions, 0 deletions
diff --git a/spec/lock/flex_spec.rb b/spec/lock/lockfile_spec.rb
index bdc7d5f1..d49ede5c 100644
--- a/spec/lock/flex_spec.rb
+++ b/spec/lock/lockfile_spec.rb
@@ -647,4 +647,37 @@ describe "the lockfile format" do
G
end
+
+ context "line endings" do
+ before(:each) do
+ build_repo2
+ install_gemfile <<-G
+ source "file://#{gem_repo2}"
+ gem "rack"
+ G
+ end
+
+ it "generates Gemfile.lock with \\n line endings" do
+ File.read(bundled_app("Gemfile.lock")).should_not match("\r\n")
+ should_be_installed "rack 1.0"
+ end
+
+ it "preserves Gemfile.lock \\n line endings" do
+ update_repo2
+
+ bundle "update"
+ File.read(bundled_app("Gemfile.lock")).should_not match("\r\n")
+ should_be_installed "rack 1.2"
+ end
+
+ it "preserves Gemfile.lock \\n\\r line endings" do
+ update_repo2
+ win_lock = File.read(bundled_app("Gemfile.lock")).gsub(/\n/, "\r\n")
+ File.open(bundled_app("Gemfile.lock"), "wb"){|f| f.puts(win_lock) }
+
+ bundle "update"
+ File.read(bundled_app("Gemfile.lock")).should match("\r\n")
+ should_be_installed "rack 1.2"
+ end
+ end
end