From 3b71a0355bff7f4547bc4402ee657f4fc7e810be Mon Sep 17 00:00:00 2001 From: John Bintz Date: Sun, 19 Jun 2011 14:51:47 -0400 Subject: [PATCH] half-fix for #19, ensure coffeescript files have newlines separating them --- lib/jasmine/files_list.rb | 2 +- spec/lib/jasmine/files_list_spec.rb | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) 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 == [ %{},