From 73c8fef43e6cf8fa681f3e5b341f3a7b86bde6e6 Mon Sep 17 00:00:00 2001 From: Christian Williams Date: Mon, 28 Dec 2009 15:10:27 -0600 Subject: [PATCH] More changes, specs. --- lib/jasmine/{run.html => run.html.erb} | 0 lib/jasmine/server.rb | 3 ++- spec/server_spec.rb | 16 +++++++++------- 3 files changed, 11 insertions(+), 8 deletions(-) rename lib/jasmine/{run.html => run.html.erb} (100%) diff --git a/lib/jasmine/run.html b/lib/jasmine/run.html.erb similarity index 100% rename from lib/jasmine/run.html rename to lib/jasmine/run.html.erb diff --git a/lib/jasmine/server.rb b/lib/jasmine/server.rb index 3d79eb6..c293f78 100644 --- a/lib/jasmine/server.rb +++ b/lib/jasmine/server.rb @@ -15,12 +15,13 @@ module Jasmine run end + #noinspection RubyUnusedLocalVariable def run jasmine_files = @jasmine_files css_files = @jasmine_stylesheets + (Jasmine.files(@config.stylesheets) || []) js_files = Jasmine.files(@config.js_files) - body = ERB.new(File.read(File.join(File.dirname(__FILE__), "run.html"))).result(binding) + body = ERB.new(File.read(File.join(File.dirname(__FILE__), "run.html.erb"))).result(binding) [ 200, { 'Content-Type' => 'text/html' }, diff --git a/spec/server_spec.rb b/spec/server_spec.rb index f022b0e..8d0ed6b 100644 --- a/spec/server_spec.rb +++ b/spec/server_spec.rb @@ -45,12 +45,14 @@ describe Jasmine::Server do headers["Location"].should == "/" end - it "should serve /" do - code, headers, body = @thin_app.call("PATH_INFO" => "/", "SCRIPT_NAME" => "xxx") - code.should == 200 - body = read(body) - body.should include("\"/src/file1.js") - body.should include("\"/spec/file2.js") - body.should satisfy {|s| s.index("/src/file1.js") < s.index("/spec/file2.js") } + describe "/ page" do + it "should load each js file in order" do + code, headers, body = @thin_app.call("PATH_INFO" => "/", "SCRIPT_NAME" => "xxx") + code.should == 200 + body = read(body) + body.should include("\"/src/file1.js") + body.should include("\"/spec/file2.js") + body.should satisfy {|s| s.index("/src/file1.js") < s.index("/spec/file2.js") } + end end end \ No newline at end of file