diff --git a/lib/jasmine/files_list.rb b/lib/jasmine/files_list.rb index 6cda54e..11cc53b 100644 --- a/lib/jasmine/files_list.rb +++ b/lib/jasmine/files_list.rb @@ -66,7 +66,7 @@ module Jasmine def ensure_coffeescript_run!(files) data = StringIO.new - files.each { |file| data << File.read(file) } + files.each { |file| data << File.read(file) << "\n" } data.rewind %{} diff --git a/spec/lib/jasmine/files_list_spec.rb b/spec/lib/jasmine/files_list_spec.rb index 9bc7cc9..cf4027b 100644 --- a/spec/lib/jasmine/files_list_spec.rb +++ b/spec/lib/jasmine/files_list_spec.rb @@ -129,7 +129,7 @@ describe Jasmine::FilesList do File.open('test.coffee', 'w') { |fh| fh.print "first" } - CoffeeScript.stubs(:compile).with() { |field| field.read == "first" }.returns("i compiled") + CoffeeScript.stubs(:compile).with() { |field| field.read == "first\n" }.returns("i compiled") end context '#files_to_html' do @@ -172,7 +172,7 @@ describe Jasmine::FilesList do context '#files_to_html' do it "should create the right HTML" do - CoffeeScript.stubs(:compile).with() { |field| field.read == "firstsecond" }.returns("i compiled") + CoffeeScript.stubs(:compile).with() { |field| field.read == "first\nsecond\n" }.returns("i compiled") files_list.files_to_html.should == [ %{}, @@ -184,7 +184,7 @@ describe Jasmine::FilesList do context '#filtered_files_to_html' do it "should create the right HTML" do - CoffeeScript.stubs(:compile).with() { |field| field.read == "first" }.returns("i compiled") + CoffeeScript.stubs(:compile).with() { |field| field.read == "first\n" }.returns("i compiled") files_list.filtered_files_to_html.should == [ %{},