Skip to content
Browse files

half-fix for #19, ensure coffeescript files have newlines separating …

…them
  • Loading branch information...
1 parent ff792b8 commit 3b71a0355bff7f4547bc4402ee657f4fc7e810be @johnbintz johnbintz committed Jun 19, 2011
Showing with 4 additions and 4 deletions.
  1. +1 −1 lib/jasmine/files_list.rb
  2. +3 −3 spec/lib/jasmine/files_list_spec.rb
View
2 lib/jasmine/files_list.rb
@@ -66,7 +66,7 @@ def to_html(files)
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
%{<script type="text/javascript">#{CoffeeScript.compile(data)}</script>}
View
6 spec/lib/jasmine/files_list_spec.rb
@@ -129,7 +129,7 @@
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 @@
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 == [
%{<script type="text/javascript" src="test.js"></script>},
@@ -184,7 +184,7 @@
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 == [
%{<script type="text/javascript" src="test.js"></script>},

0 comments on commit 3b71a03

Please sign in to comment.
Something went wrong with that request. Please try again.