half-fix for #19, ensure coffeescript files have newlines separating them
This commit is contained in:
parent
ff792b81f6
commit
3b71a0355b
@ -66,7 +66,7 @@ module Jasmine
|
|||||||
|
|
||||||
def ensure_coffeescript_run!(files)
|
def ensure_coffeescript_run!(files)
|
||||||
data = StringIO.new
|
data = StringIO.new
|
||||||
files.each { |file| data << File.read(file) }
|
files.each { |file| data << File.read(file) << "\n" }
|
||||||
data.rewind
|
data.rewind
|
||||||
|
|
||||||
%{<script type="text/javascript">#{CoffeeScript.compile(data)}</script>}
|
%{<script type="text/javascript">#{CoffeeScript.compile(data)}</script>}
|
||||||
|
@ -129,7 +129,7 @@ describe Jasmine::FilesList do
|
|||||||
|
|
||||||
File.open('test.coffee', 'w') { |fh| fh.print "first" }
|
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
|
end
|
||||||
|
|
||||||
context '#files_to_html' do
|
context '#files_to_html' do
|
||||||
@ -172,7 +172,7 @@ describe Jasmine::FilesList do
|
|||||||
|
|
||||||
context '#files_to_html' do
|
context '#files_to_html' do
|
||||||
it "should create the right 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 == [
|
files_list.files_to_html.should == [
|
||||||
%{<script type="text/javascript" src="test.js"></script>},
|
%{<script type="text/javascript" src="test.js"></script>},
|
||||||
@ -184,7 +184,7 @@ describe Jasmine::FilesList do
|
|||||||
|
|
||||||
context '#filtered_files_to_html' do
|
context '#filtered_files_to_html' do
|
||||||
it "should create the right 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 == [
|
files_list.filtered_files_to_html.should == [
|
||||||
%{<script type="text/javascript" src="test.js"></script>},
|
%{<script type="text/javascript" src="test.js"></script>},
|
||||||
|
Loading…
Reference in New Issue
Block a user