jasmine 1.3.2 → 2.0.0.rc2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/.travis.yml +3 -37
- data/Gemfile +11 -2
- data/HOW_TO_TEST.markdown +1 -1
- data/README.markdown +10 -10
- data/Rakefile +18 -29
- data/generators/jasmine/templates/jasmine-example/spec/PlayerSpec.js +2 -2
- data/generators/jasmine/templates/jasmine-example/spec/SpecHelper.js +14 -8
- data/generators/jasmine/templates/spec/javascripts/support/jasmine.yml +3 -3
- data/generators/jasmine/templates/spec/javascripts/support/jasmine_helper.rb +1 -0
- data/jasmine.gemspec +11 -41
- data/lib/generators/jasmine/examples/templates/spec/javascripts/helpers/SpecHelper.js +15 -9
- data/lib/generators/jasmine/examples/templates/spec/javascripts/jasmine_examples/PlayerSpec.js +1 -1
- data/lib/jasmine.rb +10 -7
- data/lib/jasmine/asset_bundle.rb +69 -0
- data/lib/jasmine/asset_expander.rb +7 -7
- data/lib/jasmine/command_line_tool.rb +18 -0
- data/lib/jasmine/config.rb +23 -15
- data/lib/jasmine/configuration.rb +14 -8
- data/lib/jasmine/core_configuration.rb +7 -4
- data/lib/jasmine/dependencies.rb +14 -18
- data/lib/jasmine/formatters/base.rb +9 -0
- data/lib/jasmine/formatters/console.rb +45 -0
- data/lib/jasmine/formatters/junit_xml.rb +47 -0
- data/lib/jasmine/path_expander.rb +1 -1
- data/lib/jasmine/railtie.rb +7 -6
- data/lib/jasmine/reporters/api_reporter.rb +38 -0
- data/lib/jasmine/results.rb +28 -9
- data/lib/jasmine/results_processor.rb +1 -1
- data/lib/jasmine/run.html.erb +1 -1
- data/lib/jasmine/run_specs.rb +12 -15
- data/lib/jasmine/runners/http.rb +11 -49
- data/lib/jasmine/selenium_driver.rb +17 -14
- data/lib/jasmine/tasks/jasmine.rake +21 -30
- data/lib/jasmine/tasks/{jasmine_rails3.rake → jasmine_rails.rake} +0 -0
- data/lib/jasmine/version.rb +1 -1
- data/lib/jasmine/yaml_config_parser.rb +9 -0
- data/release_notes/v2.0.0.rc2.md +44 -0
- data/spec/application_spec.rb +33 -38
- data/spec/asset_expander_spec.rb +4 -32
- data/spec/configuration_spec.rb +95 -35
- data/spec/jasmine_command_line_tool_spec.rb +63 -11
- data/spec/jasmine_rails_spec.rb +94 -0
- data/spec/lib/jasmine/formatters/base_spec.rb +9 -0
- data/spec/lib/jasmine/formatters/console_spec.rb +92 -0
- data/spec/lib/jasmine/formatters/junit_xml_spec.rb +55 -0
- data/spec/lib/jasmine/reporters/api_reporter_spec.rb +53 -0
- data/spec/lib/jasmine/runners/http_spec.rb +21 -0
- data/spec/path_expander_spec.rb +25 -0
- data/spec/results_spec.rb +59 -17
- data/spec/spec_helper.rb +36 -18
- data/spec/support/fake_selenium_driver.rb +35 -0
- data/spec/yaml_config_parser_spec.rb +37 -0
- metadata +65 -103
- data/generators/jasmine/templates/jasmine-example/SpecRunner.html +0 -54
- data/lib/jasmine/asset_pipeline_utility.rb +0 -19
- data/lib/jasmine/javascripts/boot.js +0 -28
- data/lib/jasmine/rspec_formatter.rb +0 -92
- data/spec/dependencies_spec.rb +0 -315
- data/spec/jasmine_rails2_spec.rb +0 -89
- data/spec/jasmine_rails3_spec.rb +0 -69
- data/spec/jasmine_self_test_spec.rb +0 -29
- data/spec/rspec_formatter_spec.rb +0 -88
data/lib/jasmine/results.rb
CHANGED
@@ -1,19 +1,38 @@
|
|
1
1
|
module Jasmine
|
2
2
|
class Results
|
3
|
+
attr_reader :results
|
3
4
|
|
4
|
-
|
5
|
-
|
6
|
-
@suites = suite_hash
|
7
|
-
@results = result_hash
|
8
|
-
@example_locations = example_locations
|
5
|
+
def initialize(raw_results)
|
6
|
+
@results = raw_results.map {|raw| Result.new(raw) }
|
9
7
|
end
|
10
8
|
|
11
|
-
def
|
12
|
-
@results
|
9
|
+
def failures
|
10
|
+
@results.select { |result|
|
11
|
+
result.status == "failed"
|
12
|
+
}
|
13
13
|
end
|
14
14
|
|
15
|
-
def
|
16
|
-
@
|
15
|
+
def pending_specs
|
16
|
+
@results.select { |result|
|
17
|
+
result.status == "pending"
|
18
|
+
}
|
19
|
+
end
|
20
|
+
|
21
|
+
def size
|
22
|
+
@results.size
|
23
|
+
end
|
24
|
+
|
25
|
+
class Result < OpenStruct
|
26
|
+
def full_name
|
27
|
+
fullName
|
28
|
+
end
|
29
|
+
|
30
|
+
def failed_expectations
|
31
|
+
failedExpectations.map { |e|
|
32
|
+
short_stack = e["stack"].split("\n").slice(0, 7).join("\n")
|
33
|
+
OpenStruct.new(:message => e["message"], :stack => short_stack)
|
34
|
+
}
|
35
|
+
end
|
17
36
|
end
|
18
37
|
end
|
19
38
|
end
|
data/lib/jasmine/run.html.erb
CHANGED
@@ -3,7 +3,7 @@
|
|
3
3
|
<head>
|
4
4
|
<meta content="text/html;charset=UTF-8" http-equiv="Content-Type"/>
|
5
5
|
<title>Jasmine suite</title>
|
6
|
-
<link rel="shortcut icon" type="image/png" href="/
|
6
|
+
<link rel="shortcut icon" type="image/png" href="/__images__/jasmine_favicon.png">
|
7
7
|
<% css_files.each do |css_file| %>
|
8
8
|
<link rel="stylesheet" href="<%= css_file %>" type="text/css" media="screen"/>
|
9
9
|
<% end %>
|
data/lib/jasmine/run_specs.rb
CHANGED
@@ -2,15 +2,7 @@ $:.unshift(ENV['JASMINE_GEM_PATH']) if ENV['JASMINE_GEM_PATH'] # for gem testing
|
|
2
2
|
|
3
3
|
require 'rubygems'
|
4
4
|
require 'jasmine'
|
5
|
-
|
6
|
-
require 'rspec'
|
7
|
-
else
|
8
|
-
require 'spec'
|
9
|
-
end
|
10
|
-
|
11
|
-
jasmine_yml = File.join(Dir.pwd, 'spec', 'javascripts', 'support', 'jasmine.yml')
|
12
|
-
if File.exist?(jasmine_yml)
|
13
|
-
end
|
5
|
+
require 'rspec'
|
14
6
|
|
15
7
|
Jasmine.load_configuration_from_yaml
|
16
8
|
|
@@ -26,11 +18,16 @@ t = Thread.new do
|
|
26
18
|
# # ignore bad exits
|
27
19
|
end
|
28
20
|
t.abort_on_exception = true
|
29
|
-
Jasmine::wait_for_listener(config.port,
|
30
|
-
puts
|
21
|
+
Jasmine::wait_for_listener(config.port, 'jasmine server')
|
22
|
+
puts 'jasmine server started.'
|
31
23
|
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
24
|
+
reporter = Jasmine::Reporters::ApiReporter.new(driver, config.result_batch_size)
|
25
|
+
raw_results = Jasmine::Runners::HTTP.new(driver, reporter).run
|
26
|
+
results = Jasmine::Results.new(raw_results)
|
27
|
+
|
28
|
+
config.formatters.each do |formatter_class|
|
29
|
+
formatter = formatter_class.new(results)
|
30
|
+
formatter.format()
|
31
|
+
end
|
36
32
|
|
33
|
+
exit results.failures.size
|
data/lib/jasmine/runners/http.rb
CHANGED
@@ -1,71 +1,33 @@
|
|
1
1
|
module Jasmine
|
2
2
|
module Runners
|
3
|
-
class HTTP
|
4
|
-
attr_accessor :suites
|
5
|
-
|
6
|
-
def initialize(client, results_processor, result_batch_size)
|
7
|
-
@client = client
|
8
|
-
@results_processor = results_processor
|
9
|
-
@result_batch_size = result_batch_size
|
10
|
-
end
|
11
|
-
|
3
|
+
class HTTP < Struct.new(:driver, :reporter)
|
12
4
|
def run
|
13
|
-
|
14
|
-
|
5
|
+
driver.connect
|
6
|
+
ensure_connection_established
|
15
7
|
wait_for_suites_to_finish_running
|
16
|
-
|
17
|
-
|
8
|
+
|
9
|
+
results = reporter.results
|
10
|
+
|
11
|
+
driver.disconnect
|
18
12
|
results
|
19
13
|
end
|
20
14
|
|
21
15
|
private
|
22
|
-
|
23
|
-
def
|
16
|
+
|
17
|
+
def ensure_connection_established
|
24
18
|
started = Time.now
|
25
|
-
|
19
|
+
until reporter.started? do
|
26
20
|
raise "couldn't connect to Jasmine after 60 seconds" if (started + 60 < Time.now)
|
27
21
|
sleep 0.1
|
28
22
|
end
|
29
|
-
|
30
|
-
@suites = eval_js("var result = jsApiReporter.suites(); if (window.Prototype && Object.toJSON) { return Object.toJSON(result) } else { return JSON.stringify(result) }")
|
31
|
-
end
|
32
|
-
|
33
|
-
def results_hash
|
34
|
-
spec_results = {}
|
35
|
-
spec_ids.each_slice(@result_batch_size) do |slice|
|
36
|
-
spec_results.merge!(eval_js("var result = jsApiReporter.resultsForSpecs(#{json_generate(slice)}); if (window.Prototype && Object.toJSON) { return Object.toJSON(result) } else { return JSON.stringify(result) }"))
|
37
|
-
end
|
38
|
-
spec_results
|
39
|
-
end
|
40
|
-
|
41
|
-
def spec_ids
|
42
|
-
map_spec_ids = lambda do |suites|
|
43
|
-
suites.map do |suite_or_spec|
|
44
|
-
if suite_or_spec['type'] == 'spec'
|
45
|
-
suite_or_spec['id']
|
46
|
-
else
|
47
|
-
map_spec_ids.call(suite_or_spec['children'])
|
48
|
-
end
|
49
|
-
end
|
50
|
-
end
|
51
|
-
map_spec_ids.call(@suites).compact.flatten
|
52
23
|
end
|
53
24
|
|
54
25
|
def wait_for_suites_to_finish_running
|
55
26
|
puts "Waiting for suite to finish in browser ..."
|
56
|
-
|
27
|
+
until reporter.finished? do
|
57
28
|
sleep 0.1
|
58
29
|
end
|
59
30
|
end
|
60
|
-
|
61
|
-
def eval_js(script)
|
62
|
-
@client.eval_js(script)
|
63
|
-
end
|
64
|
-
|
65
|
-
def json_generate(obj)
|
66
|
-
@client.json_generate(obj)
|
67
|
-
end
|
68
|
-
|
69
31
|
end
|
70
32
|
end
|
71
33
|
end
|
@@ -3,22 +3,25 @@ module Jasmine
|
|
3
3
|
class SeleniumDriver
|
4
4
|
def initialize(browser, http_address)
|
5
5
|
require 'selenium-webdriver'
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
6
|
+
|
7
|
+
selenium_server = if Jasmine.config.selenium_server
|
8
|
+
Jasmine.config.selenium_server
|
9
|
+
elsif Jasmine.config.selenium_server_port
|
10
|
+
"http://localhost:#{Jasmine.config.selenium_server_port}/wd/hub"
|
11
|
+
end
|
12
|
+
options = if browser == 'firefox-firebug'
|
13
|
+
require File.join(File.dirname(__FILE__), 'firebug/firebug')
|
14
|
+
(profile = Selenium::WebDriver::Firefox::Profile.new)
|
14
15
|
profile.enable_firebug
|
15
16
|
{:profile => profile}
|
16
17
|
end || {}
|
17
|
-
@driver = if
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
18
|
+
@driver = if Jasmine.config.webdriver
|
19
|
+
Jasmine.config.webdriver
|
20
|
+
elsif selenium_server
|
21
|
+
Selenium::WebDriver.for :remote, :url => selenium_server, :desired_capabilities => browser.to_sym
|
22
|
+
else
|
23
|
+
Selenium::WebDriver.for browser.to_sym, options
|
24
|
+
end
|
22
25
|
@http_address = http_address
|
23
26
|
end
|
24
27
|
|
@@ -32,7 +35,7 @@ module Jasmine
|
|
32
35
|
|
33
36
|
def eval_js(script)
|
34
37
|
result = @driver.execute_script(script)
|
35
|
-
JSON.parse("{\"result\":#{result}}", :max_nesting => false)[
|
38
|
+
JSON.parse("{\"result\":#{result.to_json}}", :max_nesting => false)['result']
|
36
39
|
end
|
37
40
|
|
38
41
|
def json_generate(obj)
|
@@ -1,4 +1,8 @@
|
|
1
1
|
namespace :jasmine do
|
2
|
+
require 'jasmine/config'
|
3
|
+
|
4
|
+
Jasmine.load_configuration_from_yaml
|
5
|
+
|
2
6
|
task :require do
|
3
7
|
require 'jasmine'
|
4
8
|
end
|
@@ -12,44 +16,31 @@ namespace :jasmine do
|
|
12
16
|
end
|
13
17
|
end
|
14
18
|
|
15
|
-
desc
|
16
|
-
task :ci =>
|
17
|
-
|
18
|
-
|
19
|
-
require "rspec/core/rake_task"
|
20
|
-
else
|
21
|
-
require "spec"
|
22
|
-
require 'spec/rake/spectask'
|
23
|
-
end
|
19
|
+
desc 'Run continuous integration tests'
|
20
|
+
task :ci => %w(jasmine:require_json jasmine:require) do
|
21
|
+
require 'rspec'
|
22
|
+
require 'rspec/core/rake_task'
|
24
23
|
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
t.rspec_opts += ["-r #{File.expand_path(File.join(::Rails.root, 'config', 'environment'))}"]
|
31
|
-
end
|
32
|
-
t.pattern = [Jasmine.runner_filepath]
|
33
|
-
end
|
34
|
-
else
|
35
|
-
Spec::Rake::SpecTask.new(:jasmine_continuous_integration_runner) do |t|
|
36
|
-
t.spec_opts = ["--color", "--format", ENV['JASMINE_SPEC_FORMAT'] || "specdoc"]
|
37
|
-
t.verbose = true
|
38
|
-
t.spec_files = [Jasmine.runner_filepath]
|
24
|
+
RSpec::Core::RakeTask.new(:jasmine_continuous_integration_runner) do |t|
|
25
|
+
t.rspec_opts = ['--colour', '--format', Jasmine.config.spec_format || 'progress']
|
26
|
+
t.verbose = true
|
27
|
+
if Jasmine::Dependencies.use_asset_pipeline?
|
28
|
+
t.rspec_opts += ["-r #{File.expand_path(File.join(::Rails.root, 'config', 'environment'))}"]
|
39
29
|
end
|
30
|
+
t.pattern = [Jasmine.runner_filepath]
|
40
31
|
end
|
41
|
-
|
32
|
+
|
33
|
+
Rake::Task['jasmine_continuous_integration_runner'].invoke
|
42
34
|
end
|
43
35
|
|
44
|
-
task :server =>
|
45
|
-
port =
|
46
|
-
puts
|
36
|
+
task :server => 'jasmine:require' do
|
37
|
+
port = Jasmine.config.jasmine_port || 8888
|
38
|
+
puts 'your tests are here:'
|
47
39
|
puts " http://localhost:#{port}/"
|
48
|
-
Jasmine.load_configuration_from_yaml
|
49
40
|
app = Jasmine::Application.app(Jasmine.config)
|
50
41
|
Jasmine::Server.new(port, app).start
|
51
42
|
end
|
52
43
|
end
|
53
44
|
|
54
|
-
desc
|
55
|
-
task :jasmine =>
|
45
|
+
desc 'Run specs via server'
|
46
|
+
task :jasmine => %w(jasmine:server)
|
File without changes
|
data/lib/jasmine/version.rb
CHANGED
@@ -22,6 +22,11 @@ module Jasmine
|
|
22
22
|
File.join(@pwd, loaded_yaml['jasmine_dir'])
|
23
23
|
end
|
24
24
|
|
25
|
+
def boot_dir
|
26
|
+
return nil unless loaded_yaml['boot_dir']
|
27
|
+
File.join(@pwd, loaded_yaml['boot_dir'])
|
28
|
+
end
|
29
|
+
|
25
30
|
def src_files
|
26
31
|
@path_expander.call(src_dir, loaded_yaml['src_files'] || [])
|
27
32
|
end
|
@@ -30,6 +35,10 @@ module Jasmine
|
|
30
35
|
@path_expander.call(jasmine_dir, loaded_yaml['jasmine_files'] || [])
|
31
36
|
end
|
32
37
|
|
38
|
+
def boot_files
|
39
|
+
@path_expander.call(boot_dir, loaded_yaml['boot_files'] || [])
|
40
|
+
end
|
41
|
+
|
33
42
|
def jasmine_css_files
|
34
43
|
@path_expander.call(jasmine_dir, loaded_yaml['jasmine_css_files'] || [])
|
35
44
|
end
|
@@ -0,0 +1,44 @@
|
|
1
|
+
# Jasmine Gem 2.0 Release Notes
|
2
|
+
|
3
|
+
## Summary
|
4
|
+
|
5
|
+
These notes cover v2.0.0.rc2.
|
6
|
+
|
7
|
+
## Changes
|
8
|
+
|
9
|
+
* Support for changes in Jasmine 2.0
|
10
|
+
* hooks for `boot_dir` and `boot_files`
|
11
|
+
* New resutls interface in reporters
|
12
|
+
* Results Formatters
|
13
|
+
* New console results formatter for CI tasks - no longer depend on RSpec for console output
|
14
|
+
* Optional JUnit XML results formatter for CI tasks
|
15
|
+
* Projects can provide custom formatters
|
16
|
+
* Rails 4 support
|
17
|
+
* Better support for non-Rails Ruby projects
|
18
|
+
* Loosely pinning to jasmine-core, allowing for jasmine-core's build to work on release for jasmine build to work.
|
19
|
+
* SHA: 42021e3a86e57f6b7b23dfbe921867d7560f4e4f
|
20
|
+
* Add warning to jasmine init
|
21
|
+
* SHA: e071474b014e7d6909d69f86988b84eacb801201
|
22
|
+
* Globbing should now return files in a consistent, predictable order across systems
|
23
|
+
* Reactivated the Rails integration tests; fix resulting issues
|
24
|
+
* Added the configuration option to specify your own webdriver instance
|
25
|
+
* Brought back the Jasmine Favicon
|
26
|
+
|
27
|
+
## Dropped Support
|
28
|
+
|
29
|
+
* ENV variables removed - use Jasmine.configure to set browser, ports, etc.
|
30
|
+
* Dropped support for 1.8.x Rubies, Rails 2, RSpec 1 - please continue to use Jasmine gem 1.3.2
|
31
|
+
* "self-test" is gone as [Jasmine core now tests itself](http://travis-ci.org/pivotal/jasmine)
|
32
|
+
|
33
|
+
## Pull Requests
|
34
|
+
|
35
|
+
* Fix README.markdown and add config example #[144](http://github.com/pivotal/jasmine-gem/pull/144) from enrapt-mochizuki
|
36
|
+
* Use a relative path to jasmine repo in Gemfile #[161](http://github.com/pivotal/jasmine-gem/pull/161) from zephyr-dev
|
37
|
+
* Problem when using a asset prefix other than '/assets' #[155](http://github.com/pivotal/jasmine-gem/pull/155) from janv
|
38
|
+
* Remove unused code - #[154]((http://github.com/pivotal/jasmine-gem/pull/154) from daytonn
|
39
|
+
* Fix default path for :spec_helper in template #[147]((http://github.com/pivotal/jasmine-gem/pull/147) from kmayer
|
40
|
+
* Improve Gemfile installation instructions #[141]((http://github.com/pivotal/jasmine-gem/pull/141)
|
41
|
+
|
42
|
+
------
|
43
|
+
|
44
|
+
_Release Notes generated with [Anchorman](http://github.com/infews/anchorman)_
|
data/spec/application_spec.rb
CHANGED
@@ -1,44 +1,39 @@
|
|
1
1
|
require 'spec_helper'
|
2
2
|
|
3
|
-
|
4
|
-
|
3
|
+
describe 'Jasmine::Application' do
|
4
|
+
it 'should map paths provided by the config' do
|
5
|
+
handler1 = double(:handler1)
|
6
|
+
handler2 = double(:handler2)
|
7
|
+
app1 = double(:app1)
|
8
|
+
app2 = double(:app2)
|
9
|
+
rack_path_map = {'/foo' => lambda { handler1 }, '/bar' => lambda { handler2 }}
|
10
|
+
config = double(:config, :rack_path_map => rack_path_map, :rack_apps => [])
|
11
|
+
builder = double('Rack::Builder.new')
|
12
|
+
#Rack::Builder instance evals, so builder.run is invalid syntax,
|
13
|
+
#this is the only way to stub out the 'run' dsl it gives to the block.
|
14
|
+
Jasmine::Application.stub(:run).with(handler1).and_return(app1)
|
15
|
+
Jasmine::Application.stub(:run).with(handler2).and_return(app2)
|
5
16
|
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
rack_path_map = {"/foo" => lambda { handler1 }, "/bar" => lambda { handler2 }}
|
14
|
-
config = double(:config, :rack_path_map => rack_path_map, :rack_apps => [])
|
15
|
-
builder = double("Rack::Builder.new")
|
16
|
-
#Rack::Builder instance evals, so builder.run is invalid syntax,
|
17
|
-
#this is the only way to stub out the 'run' dsl it gives to the block.
|
18
|
-
Jasmine::Application.stub(:run).with(handler1).and_return(app1)
|
19
|
-
Jasmine::Application.stub(:run).with(handler2).and_return(app2)
|
20
|
-
|
21
|
-
builder.should_receive(:map).twice do |path, &app|
|
22
|
-
if path == '/foo'
|
23
|
-
app.call.should == app1
|
24
|
-
elsif path == '/bar'
|
25
|
-
app.call.should == app2
|
26
|
-
else
|
27
|
-
raise "Unexpected path passed"
|
28
|
-
end
|
17
|
+
builder.should_receive(:map).twice do |path, &app|
|
18
|
+
if path == '/foo'
|
19
|
+
app.call.should == app1
|
20
|
+
elsif path == '/bar'
|
21
|
+
app.call.should == app2
|
22
|
+
else
|
23
|
+
raise 'Unexpected path passed'
|
29
24
|
end
|
30
|
-
|
31
|
-
Jasmine::Application.app(config, builder).should == builder
|
32
|
-
end
|
33
|
-
it "should run rack apps provided by the config" do
|
34
|
-
app1 = double(:app1)
|
35
|
-
app2 = double(:app2)
|
36
|
-
block = lambda { "foo" }
|
37
|
-
config = double(:config, :rack_path_map => [], :rack_apps => [[app1, nil], [app2, block]])
|
38
|
-
builder = double("Rack::Builder.new")
|
39
|
-
builder.should_receive(:use).with(app1)
|
40
|
-
builder.should_receive(:use).with(app2, &block)
|
41
|
-
Jasmine::Application.app(config, builder).should == builder
|
42
25
|
end
|
26
|
+
|
27
|
+
Jasmine::Application.app(config, builder).should == builder
|
28
|
+
end
|
29
|
+
it 'should run rack apps provided by the config' do
|
30
|
+
app1 = double(:app1)
|
31
|
+
app2 = double(:app2)
|
32
|
+
block = lambda { 'foo' }
|
33
|
+
config = double(:config, :rack_path_map => [], :rack_apps => [[app1, nil], [app2, block]])
|
34
|
+
builder = double('Rack::Builder.new')
|
35
|
+
builder.should_receive(:use).with(app1)
|
36
|
+
builder.should_receive(:use).with(app2, &block)
|
37
|
+
Jasmine::Application.app(config, builder).should == builder
|
43
38
|
end
|
44
|
-
end
|
39
|
+
end
|