diff options
author | Samuel E. Giddins <segiddins@segiddins.me> | 2015-03-18 15:01:00 -0700 |
---|---|---|
committer | Samuel E. Giddins <segiddins@segiddins.me> | 2015-03-18 21:01:58 -0700 |
commit | d6518fe39edb130da268133c82bccb69f5788a3b (patch) | |
tree | b7d4edc69d395e2c86581c56e582e5717de6b52a | |
parent | 74bcedde634020ce3bf2c1c7a4b1253e805c594d (diff) | |
download | bundler-seg-dsl-error.tar.gz |
[DSLError] Update specs for pre-2.0 rubyseg-dsl-error
-rw-r--r-- | lib/bundler/dsl.rb | 2 | ||||
-rw-r--r-- | spec/bundler/dsl_spec.rb | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/lib/bundler/dsl.rb b/lib/bundler/dsl.rb index c14f9a7ada..f9f09e8b00 100644 --- a/lib/bundler/dsl.rb +++ b/lib/bundler/dsl.rb @@ -415,7 +415,7 @@ module Bundler description = self.description if dsl_path && description =~ /((#{Regexp.quote File.expand_path(dsl_path)}|#{Regexp.quote dsl_path.to_s}):\d+)/ trace_line = Regexp.last_match[1] - description = description.sub(/#{Regexp.quote trace_line}:\s*/, '') + description = description.sub(/#{Regexp.quote trace_line}:\s*/, '').sub("\n", ' - ') end [trace_line, description] end diff --git a/spec/bundler/dsl_spec.rb b/spec/bundler/dsl_spec.rb index 1340e2de83..07743f6cbd 100644 --- a/spec/bundler/dsl_spec.rb +++ b/spec/bundler/dsl_spec.rb @@ -79,7 +79,7 @@ describe Bundler::Dsl do it "handles syntax errors with a useful message" do expect(Bundler).to receive(:read_file).with("Gemfile").and_return("}") expect { subject.eval_gemfile("Gemfile") }. - to raise_error(Bundler::GemfileError, /There was an error parsing `Gemfile`: syntax error, unexpected tSTRING_DEND. Bundler cannot continue./) + to raise_error(Bundler::GemfileError, /There was an error parsing `Gemfile`: (syntax error, unexpected tSTRING_DEND|(compile error - )?syntax error, unexpected '}'). Bundler cannot continue./) end end @@ -176,7 +176,7 @@ describe Bundler::Dsl do it "will raise a Bundler::GemfileError" do gemfile "gem 'foo', :path => /unquoted/string/syntax/error" expect { Bundler::Dsl.evaluate(bundled_app("Gemfile"), nil, true) }. - to raise_error(Bundler::GemfileError, /There was an error parsing `Gemfile`: unknown regexp options - trg. Bundler cannot continue./) + to raise_error(Bundler::GemfileError, /There was an error parsing `Gemfile`:( compile error -)? unknown regexp options - trg. Bundler cannot continue./) end end |