pivotal-screw-unit-server 0.5.9 → 0.5.10
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGES +3 -0
- data/Rakefile +1 -1
- data/VERSION.yml +2 -2
- data/lib/screw_unit.rb +2 -2
- data/spec/functional/functional_spec.rb +1 -1
- data/spec/unit/{js_test_core/specs/spec_file_spec.rb → spec_file_spec.rb} +1 -1
- data/standalone.ru +1 -18
- data/vendor/js-test-core/CHANGES +1 -0
- data/vendor/js-test-core/lib/js_test_core.rb +2 -1
- data/vendor/js-test-core/lib/js_test_core/server.rb +36 -0
- data/vendor/js-test-core/spec/unit/js_test_core/server_spec.rb +50 -0
- metadata +6 -6
- data/lib/screw_unit/representations.rb +0 -2
- data/lib/screw_unit/server.rb +0 -12
data/CHANGES
CHANGED
data/Rakefile
CHANGED
@@ -20,7 +20,7 @@ begin
|
|
20
20
|
s.rdoc_options = ["--main", "README.markdown"]
|
21
21
|
s.extra_rdoc_files = ["README.markdown", "CHANGES"]
|
22
22
|
s.add_dependency("thin", ">=1.2.1")
|
23
|
-
s.add_dependency("erector", ">=0.6.
|
23
|
+
s.add_dependency("erector", ">=0.6.7")
|
24
24
|
s.add_dependency("selenium-client")
|
25
25
|
end
|
26
26
|
rescue LoadError
|
data/VERSION.yml
CHANGED
data/lib/screw_unit.rb
CHANGED
@@ -4,11 +4,11 @@ dir = File.dirname(__FILE__)
|
|
4
4
|
$:.unshift(File.expand_path("#{dir}/../vendor/js-test-core/lib"))
|
5
5
|
require "js_test_core"
|
6
6
|
|
7
|
-
require "#{dir}/screw_unit/representations"
|
8
|
-
require "#{dir}/screw_unit/server"
|
7
|
+
require "#{dir}/screw_unit/representations/spec.html"
|
9
8
|
|
10
9
|
JsTestCore.core_path = File.expand_path("#{dir}/../core/lib")
|
11
10
|
JsTestCore::Resources::SpecFile.spec_representation_class = ScrewUnit::Representations::Spec
|
11
|
+
JsTestCore::Server.rackup_path = File.expand_path("#{dir}/../standalone.ru")
|
12
12
|
module ScrewUnit
|
13
13
|
include JsTestCore
|
14
14
|
|
data/standalone.ru
CHANGED
@@ -1,20 +1,3 @@
|
|
1
1
|
dir = File.dirname(__FILE__)
|
2
2
|
require "#{dir}/lib/screw_unit"
|
3
|
-
|
4
|
-
|
5
|
-
ScrewUnit.spec_root_path = ENV["SCREW_UNIT_SPEC_ROOT"] || File.expand_path("./spec/javascripts")
|
6
|
-
if File.directory?(ScrewUnit.spec_root_path)
|
7
|
-
puts "SCREW_UNIT_SPEC_ROOT is #{ScrewUnit.spec_root_path}"
|
8
|
-
else
|
9
|
-
raise "SCREW_UNIT_SPEC_ROOT #{ScrewUnit.spec_root_path} must be a directory"
|
10
|
-
end
|
11
|
-
|
12
|
-
ScrewUnit.public_path = ENV["SCREW_UNIT_PUBLIC"] || File.expand_path("./public")
|
13
|
-
if File.directory?(ScrewUnit.public_path)
|
14
|
-
puts "SCREW_UNIT_PUBLIC is #{ScrewUnit.public_path}"
|
15
|
-
else
|
16
|
-
raise "SCREW_UNIT_PUBLIC #{ScrewUnit.public_path} must be a directory"
|
17
|
-
end
|
18
|
-
|
19
|
-
use ScrewUnit::App
|
20
|
-
run Sinatra::Application
|
3
|
+
ScrewUnit::Server.standalone_rackup(self, ENV["SCREW_UNIT_SPEC_ROOT"], ENV["SCREW_UNIT_PUBLIC"])
|
data/vendor/js-test-core/CHANGES
CHANGED
@@ -1,3 +1,4 @@
|
|
1
|
+
- Updated to erector 0.6.7, which fixes a bug related to including modules into Representations.
|
1
2
|
- Allow test suite to clear all cookies
|
2
3
|
- No longer using the /implementanions directory. Replace all cases of /implementations with /javascripts.
|
3
4
|
- Added support for custom suite files
|
@@ -1,6 +1,6 @@
|
|
1
1
|
require "rubygems"
|
2
2
|
gem "thin", ">=1.2.1"
|
3
|
-
gem "erector", ">=0.6.
|
3
|
+
gem "erector", ">=0.6.7"
|
4
4
|
gem "selenium-client"
|
5
5
|
|
6
6
|
dir = File.dirname(__FILE__)
|
@@ -22,6 +22,7 @@ require "#{dir}/js_test_core/extensions"
|
|
22
22
|
require "#{dir}/js_test_core/models"
|
23
23
|
require "#{dir}/js_test_core/resources"
|
24
24
|
require "#{dir}/js_test_core/representations"
|
25
|
+
require "#{dir}/js_test_core/server"
|
25
26
|
|
26
27
|
require "#{dir}/js_test_core/client"
|
27
28
|
require "#{dir}/js_test_core/selenium_server_configuration"
|
@@ -0,0 +1,36 @@
|
|
1
|
+
module JsTestCore
|
2
|
+
class Server
|
3
|
+
class << self
|
4
|
+
attr_accessor :rackup_path
|
5
|
+
def start
|
6
|
+
require "thin"
|
7
|
+
Thin::Runner.new([
|
8
|
+
"--port", "8080",
|
9
|
+
"--rackup", File.expand_path(rackup_path),
|
10
|
+
"start"]
|
11
|
+
).run!
|
12
|
+
end
|
13
|
+
|
14
|
+
def standalone_rackup(rack_builder, spec_root_path=nil, public_path=nil)
|
15
|
+
require "sinatra"
|
16
|
+
|
17
|
+
JsTestCore.spec_root_path = spec_root_path || File.expand_path("./spec/javascripts")
|
18
|
+
if File.directory?(JsTestCore.spec_root_path)
|
19
|
+
puts "Spec root path is #{JsTestCore.spec_root_path}"
|
20
|
+
else
|
21
|
+
raise ArgumentError, "#{spec_root_path} #{JsTestCore.spec_root_path} must be a directory"
|
22
|
+
end
|
23
|
+
|
24
|
+
JsTestCore.public_path = public_path || File.expand_path("./public")
|
25
|
+
if File.directory?(JsTestCore.public_path)
|
26
|
+
puts "Public path is #{JsTestCore.public_path}"
|
27
|
+
else
|
28
|
+
raise ArgumentError, "#{public_path} #{JsTestCore.public_path} must be a directory"
|
29
|
+
end
|
30
|
+
|
31
|
+
rack_builder.use JsTestCore::App
|
32
|
+
rack_builder.run Sinatra::Application
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
@@ -0,0 +1,50 @@
|
|
1
|
+
require File.expand_path("#{File.dirname(__FILE__)}/../unit_spec_helper")
|
2
|
+
|
3
|
+
module JsTestCore
|
4
|
+
describe Server do
|
5
|
+
describe ".standalone_rackup" do
|
6
|
+
attr_reader :builder
|
7
|
+
before do
|
8
|
+
stub(Server).puts
|
9
|
+
@builder = "builder"
|
10
|
+
end
|
11
|
+
|
12
|
+
context "when passed a nil spec_root_path and a nil public_path" do
|
13
|
+
it "defaults spec_root_path to ./spec/javascripts and public_path to ./public" do
|
14
|
+
expected_spec_root_path = File.expand_path("./spec/javascripts")
|
15
|
+
mock(File).directory?( expected_spec_root_path) {true}
|
16
|
+
expected_public_path = File.expand_path("./public")
|
17
|
+
mock(File).directory?( expected_public_path) {true}
|
18
|
+
mock(builder).use(JsTestCore::App)
|
19
|
+
mock(builder).run(Sinatra::Application)
|
20
|
+
|
21
|
+
Server.standalone_rackup(builder, nil, nil)
|
22
|
+
|
23
|
+
JsTestCore.spec_root_path.should == File.expand_path(expected_spec_root_path)
|
24
|
+
JsTestCore.public_path.should == File.expand_path(expected_public_path)
|
25
|
+
end
|
26
|
+
end
|
27
|
+
|
28
|
+
context "when the spec_root_path is not a directory" do
|
29
|
+
it "raises an ArgumentError" do
|
30
|
+
mock(File).directory?("spec_root_path") {false}
|
31
|
+
|
32
|
+
lambda do
|
33
|
+
Server.standalone_rackup(builder, "spec_root_path", nil)
|
34
|
+
end.should raise_error(ArgumentError)
|
35
|
+
end
|
36
|
+
end
|
37
|
+
|
38
|
+
context "when the public_path is not a directory" do
|
39
|
+
it "raises an ArgumentError" do
|
40
|
+
mock(File).directory?("spec_root_path") {true}
|
41
|
+
mock(File).directory?("public_path") {false}
|
42
|
+
|
43
|
+
lambda do
|
44
|
+
Server.standalone_rackup(builder, "spec_root_path", "public_path")
|
45
|
+
end.should raise_error(ArgumentError)
|
46
|
+
end
|
47
|
+
end
|
48
|
+
end
|
49
|
+
end
|
50
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pivotal-screw-unit-server
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.10
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Pivotal Labs
|
@@ -10,7 +10,7 @@ autorequire:
|
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
12
|
|
13
|
-
date: 2009-06-
|
13
|
+
date: 2009-06-17 00:00:00 -07:00
|
14
14
|
default_executable:
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
@@ -31,7 +31,7 @@ dependencies:
|
|
31
31
|
requirements:
|
32
32
|
- - ">="
|
33
33
|
- !ruby/object:Gem::Version
|
34
|
-
version: 0.6.
|
34
|
+
version: 0.6.7
|
35
35
|
version:
|
36
36
|
- !ruby/object:Gem::Dependency
|
37
37
|
name: selenium-client
|
@@ -87,9 +87,7 @@ files:
|
|
87
87
|
- core/spec/with_screw_context_spec.js
|
88
88
|
- init.rb
|
89
89
|
- lib/screw_unit.rb
|
90
|
-
- lib/screw_unit/representations.rb
|
91
90
|
- lib/screw_unit/representations/spec.html.rb
|
92
|
-
- lib/screw_unit/server.rb
|
93
91
|
- spec/functional_suite.rb
|
94
92
|
- spec/spec_suite.rb
|
95
93
|
- spec/unit_suite.rb
|
@@ -121,6 +119,7 @@ files:
|
|
121
119
|
- vendor/js-test-core/lib/js_test_core/resources/spec_file.rb
|
122
120
|
- vendor/js-test-core/lib/js_test_core/resources/web_root.rb
|
123
121
|
- vendor/js-test-core/lib/js_test_core/selenium_server_configuration.rb
|
122
|
+
- vendor/js-test-core/lib/js_test_core/server.rb
|
124
123
|
- vendor/js-test-core/spec/example_core/JsTestCore.css
|
125
124
|
- vendor/js-test-core/spec/example_core/JsTestCore.js
|
126
125
|
- vendor/js-test-core/spec/example_core/subdir/SubDirFile.js
|
@@ -152,6 +151,7 @@ files:
|
|
152
151
|
- vendor/js-test-core/spec/unit/js_test_core/resources/spec_file_spec.rb
|
153
152
|
- vendor/js-test-core/spec/unit/js_test_core/resources/web_root_spec.rb
|
154
153
|
- vendor/js-test-core/spec/unit/js_test_core/selenium_server_configuration_spec.rb
|
154
|
+
- vendor/js-test-core/spec/unit/js_test_core/server_spec.rb
|
155
155
|
- vendor/js-test-core/spec/unit/unit_spec_helper.rb
|
156
156
|
- vendor/js-test-core/spec/unit_suite.rb
|
157
157
|
- vendor/js-test-core/vendor/lucky-luciano/README.markdown
|
@@ -195,6 +195,6 @@ test_files:
|
|
195
195
|
- spec/functional/functional_spec.rb
|
196
196
|
- spec/functional/functional_spec_helper.rb
|
197
197
|
- spec/spec_suite.rb
|
198
|
-
- spec/unit/js_test_core/specs/spec_file_spec.rb
|
199
198
|
- spec/unit/unit_spec_helper.rb
|
199
|
+
- spec/unit/spec_file_spec.rb
|
200
200
|
- spec/functional_suite.rb
|
data/lib/screw_unit/server.rb
DELETED