From 0eaff1f5900e57959917845964a87e18727d22c2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Roman=20Kr=CC=8Ci=CC=81z=CC=8C?= Date: Fri, 24 Apr 2015 09:34:36 +0200 Subject: [PATCH] [spec] Fix problems with trailing newlines for compressed output --- spec/rails_spec.rb | 1 + spec/stylus_spec.rb | 2 ++ spec/tilt/stylus_spec.rb | 1 + 3 files changed, 4 insertions(+) diff --git a/spec/rails_spec.rb b/spec/rails_spec.rb index 58b188f..d758c89 100644 --- a/spec/rails_spec.rb +++ b/spec/rails_spec.rb @@ -35,6 +35,7 @@ it 'compress the output if Rails is configured to compress them too' do result = fixture(:compressed).last + result.rstrip! # because of modern text editors automatically adding new lines at the end of file app = create_app(:compress => true) app.assets['compressed'].to_s.should == result diff --git a/spec/stylus_spec.rb b/spec/stylus_spec.rb index c034bd6..aaaead1 100644 --- a/spec/stylus_spec.rb +++ b/spec/stylus_spec.rb @@ -14,12 +14,14 @@ it 'compress the file when the "compress" flag is given' do input, output = fixture(:compressed) + output.rstrip! # because of modern text editors automatically adding new lines at the end of file expect(Stylus.compile(input, compress: true)).to eq(output) end it 'handles the compress flag globally' do Stylus.compress = true input, output = fixture(:compressed) + output.rstrip! # because of modern text editors automatically adding new lines at the end of file expect(Stylus.compile(input)).to eq(output) end diff --git a/spec/tilt/stylus_spec.rb b/spec/tilt/stylus_spec.rb index 7f127d3..7328ca7 100644 --- a/spec/tilt/stylus_spec.rb +++ b/spec/tilt/stylus_spec.rb @@ -19,6 +19,7 @@ it 'compiles with the compress option' do input, output = fixture(:compressed) template = Tilt::StylusTemplate.new(compress: true) { |_| input } + output.rstrip! # because of modern text editors automatically adding new lines at the end of file expect(template.render).to eq(output) end end