upjs-rails 0.11.0 → 0.11.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +10 -1
- data/dist/up.js +138 -81
- data/dist/up.min.js +2 -2
- data/lib/assets/javascripts/up/boot.js.coffee +3 -0
- data/lib/assets/javascripts/up/browser.js.coffee +42 -26
- data/lib/assets/javascripts/up/flow.js.coffee +6 -4
- data/lib/assets/javascripts/up/history.js.coffee +1 -1
- data/lib/assets/javascripts/up/modal.js.coffee +4 -4
- data/lib/assets/javascripts/up/motion.js.coffee +6 -4
- data/lib/assets/javascripts/up/proxy.js.coffee +2 -1
- data/lib/assets/javascripts/up/util.js.coffee +61 -32
- data/lib/assets/javascripts/up.js.coffee +1 -10
- data/lib/upjs/rails/version.rb +1 -1
- data/spec_app/config/environments/development.rb +1 -1
- data/spec_app/spec/javascripts/helpers/reset_path.js.coffee +3 -2
- data/spec_app/spec/javascripts/up/flow_spec.js.coffee +1 -1
- data/spec_app/spec/javascripts/up/history_spec.js.coffee +53 -47
- data/spec_app/spec/javascripts/up/link_spec.js.coffee +1 -1
- data/spec_app/spec/javascripts/up/motion_spec.js.coffee +4 -4
- data/spec_app/spec/javascripts/up/proxy_spec.js.coffee +18 -9
- data/spec_app/vendor/assets/bower_components/jasmine/.bower.json +43 -7
- data/spec_app/vendor/assets/bower_components/jasmine/CONTRIBUTING.md +26 -17
- data/spec_app/vendor/assets/bower_components/jasmine/README.md +27 -18
- data/spec_app/vendor/assets/bower_components/jasmine/RELEASE.md +15 -5
- data/spec_app/vendor/assets/bower_components/jasmine/bower.json +41 -0
- data/spec_app/vendor/assets/bower_components/jasmine/lib/console/console.js +27 -3
- data/spec_app/vendor/assets/bower_components/jasmine/lib/jasmine-core/boot.js +10 -9
- data/spec_app/vendor/assets/bower_components/jasmine/lib/jasmine-core/example/node_example/{src → lib/jasmine_examples}/Player.js +0 -0
- data/spec_app/vendor/assets/bower_components/jasmine/lib/jasmine-core/example/node_example/{src → lib/jasmine_examples}/Song.js +0 -0
- data/spec_app/vendor/assets/bower_components/jasmine/lib/jasmine-core/jasmine-html.js +76 -20
- data/spec_app/vendor/assets/bower_components/jasmine/lib/jasmine-core/jasmine.css +15 -18
- data/spec_app/vendor/assets/bower_components/jasmine/lib/jasmine-core/jasmine.js +1399 -694
- data/spec_app/vendor/assets/bower_components/jasmine/lib/jasmine-core/json2.js +73 -62
- data/spec_app/vendor/assets/bower_components/jasmine/lib/jasmine-core/node_boot.js +1 -1
- data/spec_app/vendor/assets/bower_components/jasmine/lib/jasmine-core.js +29 -31
- data/spec_app/vendor/assets/bower_components/jasmine/package.json +18 -7
- data/spec_app/vendor/assets/bower_components/jasmine-ajax/.bower.json +11 -13
- data/spec_app/vendor/assets/bower_components/jasmine-ajax/MIT.LICENSE +1 -1
- data/spec_app/vendor/assets/bower_components/jasmine-ajax/README.markdown +198 -125
- data/spec_app/vendor/assets/bower_components/jasmine-ajax/bower.json +9 -10
- data/spec_app/vendor/assets/bower_components/jasmine-ajax/lib/mock-ajax.js +250 -59
- data/spec_app/vendor/assets/bower_components/jasmine-ajax/package.json +9 -4
- data/spec_app/vendor/assets/bower_components/jasmine-ajax/release_notes/2.0.2.md +50 -0
- data/spec_app/vendor/assets/bower_components/jasmine-ajax/release_notes/2.99.md +14 -0
- data/spec_app/vendor/assets/bower_components/jasmine-ajax/release_notes/3.0.md +28 -0
- data/spec_app/vendor/assets/bower_components/jasmine-ajax/release_notes/3.1.0.md +24 -0
- data/spec_app/vendor/assets/bower_components/jasmine-ajax/release_notes/3.1.1.md +23 -0
- data/spec_app/vendor/assets/bower_components/jasmine-ajax/release_notes/3.2.0.md +20 -0
- data/spec_app/vendor/assets/bower_components/jasmine-fixture/.bower.json +4 -4
- data/spec_app/vendor/assets/bower_components/jasmine-fixture/bower.json +1 -1
- data/spec_app/vendor/assets/bower_components/jasmine-fixture/dist/jasmine-fixture.js +4 -4
- data/spec_app/vendor/assets/bower_components/jasmine-fixture/dist/jasmine-fixture.min.js +2 -2
- data/spec_app/vendor/assets/bower_components/jasmine-jquery/.bower.json +4 -4
- data/spec_app/vendor/assets/bower_components/jasmine-jquery/Gruntfile.js +17 -1
- data/spec_app/vendor/assets/bower_components/jasmine-jquery/{MIT.LICENSE → LICENSE} +0 -0
- data/spec_app/vendor/assets/bower_components/jasmine-jquery/README.md +14 -9
- data/spec_app/vendor/assets/bower_components/jasmine-jquery/bower.json +0 -1
- data/spec_app/vendor/assets/bower_components/jasmine-jquery/lib/jasmine-jquery.js +35 -10
- data/spec_app/vendor/assets/bower_components/jasmine-jquery/package.json +33 -24
- data/spec_app/vendor/assets/bower_components/jasmine-jquery/spec/fixtures/fixture_with_checkbox_with_checked.html +6 -0
- data/spec_app/vendor/assets/bower_components/jasmine-jquery/spec/suites/jasmine-jquery-spec.js +61 -1
- data/spec_app/vendor/assets/bower_components/jquery/.bower.json +5 -4
- data/spec_app/vendor/assets/bower_components/jquery/bower.json +2 -1
- data/spec_app/vendor/assets/bower_components/jquery/dist/jquery.js +9 -4
- data/spec_app/vendor/assets/bower_components/jquery/dist/jquery.min.js +4 -4
- data/spec_app/vendor/assets/bower_components/jquery/dist/jquery.min.map +1 -1
- data/spec_app/vendor/assets/bower_components/jquery/src/core.js +6 -1
- metadata +14 -175
- data/spec_app/vendor/assets/bower_components/jasmine/.gitignore +0 -24
- data/spec_app/vendor/assets/bower_components/jasmine/.gitmodules +0 -3
- data/spec_app/vendor/assets/bower_components/jasmine/.jshintrc +0 -9
- data/spec_app/vendor/assets/bower_components/jasmine/.npmignore +0 -21
- data/spec_app/vendor/assets/bower_components/jasmine/.rspec +0 -1
- data/spec_app/vendor/assets/bower_components/jasmine/.travis.yml +0 -51
- data/spec_app/vendor/assets/bower_components/jasmine/Gemfile +0 -12
- data/spec_app/vendor/assets/bower_components/jasmine/Gruntfile.js +0 -53
- data/spec_app/vendor/assets/bower_components/jasmine/Rakefile +0 -18
- data/spec_app/vendor/assets/bower_components/jasmine/dist/jasmine-standalone-1.0.0.zip +0 -0
- data/spec_app/vendor/assets/bower_components/jasmine/dist/jasmine-standalone-1.1.0.zip +0 -0
- data/spec_app/vendor/assets/bower_components/jasmine/dist/jasmine-standalone-1.2.0.zip +0 -0
- data/spec_app/vendor/assets/bower_components/jasmine/dist/jasmine-standalone-1.3.0.zip +0 -0
- data/spec_app/vendor/assets/bower_components/jasmine/dist/jasmine-standalone-1.3.1.zip +0 -0
- data/spec_app/vendor/assets/bower_components/jasmine/dist/jasmine-standalone-2.0.0.zip +0 -0
- data/spec_app/vendor/assets/bower_components/jasmine/dist/jasmine-standalone-2.0.1.zip +0 -0
- data/spec_app/vendor/assets/bower_components/jasmine/dist/jasmine-standalone-2.0.2.zip +0 -0
- data/spec_app/vendor/assets/bower_components/jasmine/dist/jasmine-standalone-2.0.3.zip +0 -0
- data/spec_app/vendor/assets/bower_components/jasmine/grunt/config/compass.js +0 -10
- data/spec_app/vendor/assets/bower_components/jasmine/grunt/config/compress.js +0 -66
- data/spec_app/vendor/assets/bower_components/jasmine/grunt/config/concat.js +0 -61
- data/spec_app/vendor/assets/bower_components/jasmine/grunt/config/jshint.js +0 -11
- data/spec_app/vendor/assets/bower_components/jasmine/grunt/tasks/build_standalone.js +0 -31
- data/spec_app/vendor/assets/bower_components/jasmine/grunt/tasks/version.js +0 -14
- data/spec_app/vendor/assets/bower_components/jasmine/grunt/templates/SpecRunner.html.jst +0 -26
- data/spec_app/vendor/assets/bower_components/jasmine/grunt/templates/licenseBanner.js.jst +0 -22
- data/spec_app/vendor/assets/bower_components/jasmine/grunt/templates/version.rb.jst +0 -9
- data/spec_app/vendor/assets/bower_components/jasmine/images/__init__.py +0 -0
- data/spec_app/vendor/assets/bower_components/jasmine/jasmine-core.gemspec +0 -23
- data/spec_app/vendor/assets/bower_components/jasmine/lib/jasmine-core/__init__.py +0 -1
- data/spec_app/vendor/assets/bower_components/jasmine/lib/jasmine-core/boot/boot.js +0 -120
- data/spec_app/vendor/assets/bower_components/jasmine/lib/jasmine-core/boot/node_boot.js +0 -19
- data/spec_app/vendor/assets/bower_components/jasmine/lib/jasmine-core/core.py +0 -60
- data/spec_app/vendor/assets/bower_components/jasmine/lib/jasmine-core/example/node_example/spec/PlayerSpec.js +0 -60
- data/spec_app/vendor/assets/bower_components/jasmine/lib/jasmine-core/example/node_example/spec/SpecHelper.js +0 -15
- data/spec_app/vendor/assets/bower_components/jasmine/lib/jasmine-core/example/spec/PlayerSpec.js +0 -58
- data/spec_app/vendor/assets/bower_components/jasmine/lib/jasmine-core/example/spec/SpecHelper.js +0 -15
- data/spec_app/vendor/assets/bower_components/jasmine/lib/jasmine-core/example/src/Player.js +0 -22
- data/spec_app/vendor/assets/bower_components/jasmine/lib/jasmine-core/example/src/Song.js +0 -7
- data/spec_app/vendor/assets/bower_components/jasmine/lib/jasmine-core/version.rb +0 -9
- data/spec_app/vendor/assets/bower_components/jasmine/lib/jasmine-core.rb +0 -53
- data/spec_app/vendor/assets/bower_components/jasmine/release_notes/2.0.1.md +0 -70
- data/spec_app/vendor/assets/bower_components/jasmine/release_notes/2.0.2.md +0 -25
- data/spec_app/vendor/assets/bower_components/jasmine/release_notes/20.md +0 -179
- data/spec_app/vendor/assets/bower_components/jasmine/setup.py +0 -47
- data/spec_app/vendor/assets/bower_components/jasmine/spec/console/ConsoleReporterSpec.js +0 -239
- data/spec_app/vendor/assets/bower_components/jasmine/spec/core/AnySpec.js +0 -46
- data/spec_app/vendor/assets/bower_components/jasmine/spec/core/CallTrackerSpec.js +0 -105
- data/spec_app/vendor/assets/bower_components/jasmine/spec/core/ClockSpec.js +0 -445
- data/spec_app/vendor/assets/bower_components/jasmine/spec/core/DelayedFunctionSchedulerSpec.js +0 -246
- data/spec_app/vendor/assets/bower_components/jasmine/spec/core/EnvSpec.js +0 -85
- data/spec_app/vendor/assets/bower_components/jasmine/spec/core/ExceptionFormatterSpec.js +0 -63
- data/spec_app/vendor/assets/bower_components/jasmine/spec/core/ExceptionsSpec.js +0 -68
- data/spec_app/vendor/assets/bower_components/jasmine/spec/core/ExpectationResultSpec.js +0 -61
- data/spec_app/vendor/assets/bower_components/jasmine/spec/core/ExpectationSpec.js +0 -427
- data/spec_app/vendor/assets/bower_components/jasmine/spec/core/JsApiReporterSpec.js +0 -214
- data/spec_app/vendor/assets/bower_components/jasmine/spec/core/MockDateSpec.js +0 -199
- data/spec_app/vendor/assets/bower_components/jasmine/spec/core/ObjectContainingSpec.js +0 -70
- data/spec_app/vendor/assets/bower_components/jasmine/spec/core/PrettyPrintSpec.js +0 -156
- data/spec_app/vendor/assets/bower_components/jasmine/spec/core/QueueRunnerSpec.js +0 -271
- data/spec_app/vendor/assets/bower_components/jasmine/spec/core/ReportDispatcherSpec.js +0 -40
- data/spec_app/vendor/assets/bower_components/jasmine/spec/core/SpecSpec.js +0 -260
- data/spec_app/vendor/assets/bower_components/jasmine/spec/core/SpySpec.js +0 -67
- data/spec_app/vendor/assets/bower_components/jasmine/spec/core/SpyStrategySpec.js +0 -111
- data/spec_app/vendor/assets/bower_components/jasmine/spec/core/SuiteSpec.js +0 -216
- data/spec_app/vendor/assets/bower_components/jasmine/spec/core/TimerSpec.js +0 -31
- data/spec_app/vendor/assets/bower_components/jasmine/spec/core/UtilSpec.js +0 -28
- data/spec_app/vendor/assets/bower_components/jasmine/spec/core/integration/CustomMatchersSpec.js +0 -149
- data/spec_app/vendor/assets/bower_components/jasmine/spec/core/integration/EnvSpec.js +0 -506
- data/spec_app/vendor/assets/bower_components/jasmine/spec/core/integration/SpecRunningSpec.js +0 -306
- data/spec_app/vendor/assets/bower_components/jasmine/spec/core/matchers/matchersUtilSpec.js +0 -239
- data/spec_app/vendor/assets/bower_components/jasmine/spec/core/matchers/toBeCloseToSpec.js +0 -51
- data/spec_app/vendor/assets/bower_components/jasmine/spec/core/matchers/toBeDefinedSpec.js +0 -18
- data/spec_app/vendor/assets/bower_components/jasmine/spec/core/matchers/toBeFalsySpec.js +0 -38
- data/spec_app/vendor/assets/bower_components/jasmine/spec/core/matchers/toBeGreaterThanSpec.js +0 -20
- data/spec_app/vendor/assets/bower_components/jasmine/spec/core/matchers/toBeLessThanSpec.js +0 -20
- data/spec_app/vendor/assets/bower_components/jasmine/spec/core/matchers/toBeNaNSpec.js +0 -37
- data/spec_app/vendor/assets/bower_components/jasmine/spec/core/matchers/toBeNullSpec.js +0 -17
- data/spec_app/vendor/assets/bower_components/jasmine/spec/core/matchers/toBeSpec.js +0 -17
- data/spec_app/vendor/assets/bower_components/jasmine/spec/core/matchers/toBeTruthySpec.js +0 -38
- data/spec_app/vendor/assets/bower_components/jasmine/spec/core/matchers/toBeUndefinedSpec.js +0 -18
- data/spec_app/vendor/assets/bower_components/jasmine/spec/core/matchers/toContainSpec.js +0 -26
- data/spec_app/vendor/assets/bower_components/jasmine/spec/core/matchers/toEqualSpec.js +0 -28
- data/spec_app/vendor/assets/bower_components/jasmine/spec/core/matchers/toHaveBeenCalledSpec.js +0 -47
- data/spec_app/vendor/assets/bower_components/jasmine/spec/core/matchers/toHaveBeenCalledWithSpec.js +0 -66
- data/spec_app/vendor/assets/bower_components/jasmine/spec/core/matchers/toMatchSpec.js +0 -34
- data/spec_app/vendor/assets/bower_components/jasmine/spec/core/matchers/toThrowErrorSpec.js +0 -280
- data/spec_app/vendor/assets/bower_components/jasmine/spec/core/matchers/toThrowSpec.js +0 -99
- data/spec_app/vendor/assets/bower_components/jasmine/spec/helpers/BrowserFlags.js +0 -23
- data/spec_app/vendor/assets/bower_components/jasmine/spec/helpers/defineJasmineUnderTest.js +0 -7
- data/spec_app/vendor/assets/bower_components/jasmine/spec/helpers/nodeDefineJasmineUnderTest.js +0 -33
- data/spec_app/vendor/assets/bower_components/jasmine/spec/html/HtmlReporterSpec.js +0 -616
- data/spec_app/vendor/assets/bower_components/jasmine/spec/html/HtmlSpecFilterSpec.js +0 -18
- data/spec_app/vendor/assets/bower_components/jasmine/spec/html/MatchersHtmlSpec.js +0 -37
- data/spec_app/vendor/assets/bower_components/jasmine/spec/html/PrettyPrintHtmlSpec.js +0 -15
- data/spec_app/vendor/assets/bower_components/jasmine/spec/html/QueryStringSpec.js +0 -43
- data/spec_app/vendor/assets/bower_components/jasmine/spec/html/ResultsNodeSpec.js +0 -62
- data/spec_app/vendor/assets/bower_components/jasmine/spec/javascripts/support/jasmine_selenium_runner.yml +0 -16
- data/spec_app/vendor/assets/bower_components/jasmine/spec/performance/large_object_test.js +0 -36
- data/spec_app/vendor/assets/bower_components/jasmine/spec/performance/performance_test.js +0 -10
- data/spec_app/vendor/assets/bower_components/jasmine/spec/support/jasmine-performance.json +0 -9
- data/spec_app/vendor/assets/bower_components/jasmine/spec/support/jasmine-performance.yml +0 -9
- data/spec_app/vendor/assets/bower_components/jasmine/spec/support/jasmine.json +0 -10
- data/spec_app/vendor/assets/bower_components/jasmine/spec/support/jasmine.yml +0 -25
- data/spec_app/vendor/assets/bower_components/jasmine/src/console/ConsoleReporter.js +0 -131
- data/spec_app/vendor/assets/bower_components/jasmine/src/console/requireConsole.js +0 -12
- data/spec_app/vendor/assets/bower_components/jasmine/src/core/Any.js +0 -36
- data/spec_app/vendor/assets/bower_components/jasmine/src/core/CallTracker.js +0 -50
- data/spec_app/vendor/assets/bower_components/jasmine/src/core/Clock.js +0 -113
- data/spec_app/vendor/assets/bower_components/jasmine/src/core/DelayedFunctionScheduler.js +0 -145
- data/spec_app/vendor/assets/bower_components/jasmine/src/core/Env.js +0 -341
- data/spec_app/vendor/assets/bower_components/jasmine/src/core/ExceptionFormatter.js +0 -29
- data/spec_app/vendor/assets/bower_components/jasmine/src/core/Expectation.js +0 -107
- data/spec_app/vendor/assets/bower_components/jasmine/src/core/ExpectationResult.js +0 -45
- data/spec_app/vendor/assets/bower_components/jasmine/src/core/JsApiReporter.js +0 -73
- data/spec_app/vendor/assets/bower_components/jasmine/src/core/MockDate.js +0 -81
- data/spec_app/vendor/assets/bower_components/jasmine/src/core/ObjectContaining.js +0 -34
- data/spec_app/vendor/assets/bower_components/jasmine/src/core/PrettyPrinter.js +0 -137
- data/spec_app/vendor/assets/bower_components/jasmine/src/core/QueueRunner.js +0 -92
- data/spec_app/vendor/assets/bower_components/jasmine/src/core/ReportDispatcher.js +0 -35
- data/spec_app/vendor/assets/bower_components/jasmine/src/core/Spec.js +0 -126
- data/spec_app/vendor/assets/bower_components/jasmine/src/core/SpyStrategy.js +0 -51
- data/spec_app/vendor/assets/bower_components/jasmine/src/core/Suite.js +0 -92
- data/spec_app/vendor/assets/bower_components/jasmine/src/core/Timer.js +0 -22
- data/spec_app/vendor/assets/bower_components/jasmine/src/core/base.js +0 -102
- data/spec_app/vendor/assets/bower_components/jasmine/src/core/matchers/matchersUtil.js +0 -181
- data/spec_app/vendor/assets/bower_components/jasmine/src/core/matchers/requireMatchers.js +0 -29
- data/spec_app/vendor/assets/bower_components/jasmine/src/core/matchers/toBe.js +0 -13
- data/spec_app/vendor/assets/bower_components/jasmine/src/core/matchers/toBeCloseTo.js +0 -18
- data/spec_app/vendor/assets/bower_components/jasmine/src/core/matchers/toBeDefined.js +0 -13
- data/spec_app/vendor/assets/bower_components/jasmine/src/core/matchers/toBeFalsy.js +0 -13
- data/spec_app/vendor/assets/bower_components/jasmine/src/core/matchers/toBeGreaterThan.js +0 -15
- data/spec_app/vendor/assets/bower_components/jasmine/src/core/matchers/toBeLessThan.js +0 -14
- data/spec_app/vendor/assets/bower_components/jasmine/src/core/matchers/toBeNaN.js +0 -22
- data/spec_app/vendor/assets/bower_components/jasmine/src/core/matchers/toBeNull.js +0 -14
- data/spec_app/vendor/assets/bower_components/jasmine/src/core/matchers/toBeTruthy.js +0 -14
- data/spec_app/vendor/assets/bower_components/jasmine/src/core/matchers/toBeUndefined.js +0 -14
- data/spec_app/vendor/assets/bower_components/jasmine/src/core/matchers/toContain.js +0 -16
- data/spec_app/vendor/assets/bower_components/jasmine/src/core/matchers/toEqual.js +0 -20
- data/spec_app/vendor/assets/bower_components/jasmine/src/core/matchers/toHaveBeenCalled.js +0 -28
- data/spec_app/vendor/assets/bower_components/jasmine/src/core/matchers/toHaveBeenCalledWith.js +0 -33
- data/spec_app/vendor/assets/bower_components/jasmine/src/core/matchers/toMatch.js +0 -16
- data/spec_app/vendor/assets/bower_components/jasmine/src/core/matchers/toThrow.js +0 -46
- data/spec_app/vendor/assets/bower_components/jasmine/src/core/matchers/toThrowError.js +0 -156
- data/spec_app/vendor/assets/bower_components/jasmine/src/core/requireCore.js +0 -39
- data/spec_app/vendor/assets/bower_components/jasmine/src/core/requireInterface.js +0 -59
- data/spec_app/vendor/assets/bower_components/jasmine/src/core/util.js +0 -44
- data/spec_app/vendor/assets/bower_components/jasmine/src/html/HtmlReporter.js +0 -280
- data/spec_app/vendor/assets/bower_components/jasmine/src/html/HtmlSpecFilter.js +0 -12
- data/spec_app/vendor/assets/bower_components/jasmine/src/html/QueryString.js +0 -47
- data/spec_app/vendor/assets/bower_components/jasmine/src/html/ResultsNode.js +0 -19
- data/spec_app/vendor/assets/bower_components/jasmine/src/html/_HTMLReporter.scss +0 -355
- data/spec_app/vendor/assets/bower_components/jasmine/src/html/jasmine.scss +0 -1
- data/spec_app/vendor/assets/bower_components/jasmine/src/html/requireHtml.js +0 -6
- data/spec_app/vendor/assets/bower_components/jasmine/src/templates/example_project_jasmine_tags.html.erb +0 -3
- data/spec_app/vendor/assets/bower_components/jasmine/src/templates/version.js.erb +0 -7
- data/spec_app/vendor/assets/bower_components/jasmine/src/templates/version.rb.erb +0 -6
- data/spec_app/vendor/assets/bower_components/jasmine/src/version.js +0 -3
- data/spec_app/vendor/assets/bower_components/jasmine/travis-core-script.sh +0 -14
- data/spec_app/vendor/assets/bower_components/jasmine/travis-docs-script.sh +0 -5
- data/spec_app/vendor/assets/bower_components/jasmine/travis-node-script.sh +0 -6
- data/spec_app/vendor/assets/bower_components/jasmine-ajax/Gruntfile.js +0 -63
- data/spec_app/vendor/assets/bower_components/jasmine-ajax/src/boot.js +0 -11
- data/spec_app/vendor/assets/bower_components/jasmine-ajax/src/fakeRequest.js +0 -262
- data/spec_app/vendor/assets/bower_components/jasmine-ajax/src/mockAjax.js +0 -45
- data/spec_app/vendor/assets/bower_components/jasmine-ajax/src/paramParser.js +0 -56
- data/spec_app/vendor/assets/bower_components/jasmine-ajax/src/requestStub.js +0 -42
- data/spec_app/vendor/assets/bower_components/jasmine-ajax/src/requestTracker.js +0 -51
- data/spec_app/vendor/assets/bower_components/jasmine-ajax/src/requireAjax.js +0 -44
- data/spec_app/vendor/assets/bower_components/jasmine-ajax/src/stubTracker.js +0 -24
@@ -1,271 +0,0 @@
|
|
1
|
-
describe("QueueRunner", function() {
|
2
|
-
|
3
|
-
it("runs all the functions it's passed", function() {
|
4
|
-
var calls = [],
|
5
|
-
fn1 = jasmine.createSpy('fn1'),
|
6
|
-
fn2 = jasmine.createSpy('fn2'),
|
7
|
-
queueRunner = new j$.QueueRunner({
|
8
|
-
fns: [fn1, fn2]
|
9
|
-
});
|
10
|
-
fn1.and.callFake(function() {
|
11
|
-
calls.push('fn1');
|
12
|
-
});
|
13
|
-
fn2.and.callFake(function() {
|
14
|
-
calls.push('fn2');
|
15
|
-
});
|
16
|
-
|
17
|
-
queueRunner.execute();
|
18
|
-
|
19
|
-
expect(calls).toEqual(['fn1', 'fn2']);
|
20
|
-
});
|
21
|
-
|
22
|
-
it("calls each function with a consistent 'this'-- an empty object", function() {
|
23
|
-
var fn1 = jasmine.createSpy('fn1'),
|
24
|
-
fn2 = jasmine.createSpy('fn2'),
|
25
|
-
fn3 = function(done) { asyncContext = this; done(); },
|
26
|
-
queueRunner = new j$.QueueRunner({
|
27
|
-
fns: [fn1, fn2, fn3]
|
28
|
-
}),
|
29
|
-
asyncContext;
|
30
|
-
|
31
|
-
queueRunner.execute();
|
32
|
-
|
33
|
-
var context = fn1.calls.first().object;
|
34
|
-
expect(context).toEqual({});
|
35
|
-
expect(fn2.calls.first().object).toBe(context);
|
36
|
-
expect(asyncContext).toBe(context);
|
37
|
-
});
|
38
|
-
|
39
|
-
describe("with an asynchronous function", function() {
|
40
|
-
beforeEach(function() {
|
41
|
-
jasmine.clock().install();
|
42
|
-
});
|
43
|
-
|
44
|
-
afterEach(function() {
|
45
|
-
jasmine.clock().uninstall();
|
46
|
-
});
|
47
|
-
|
48
|
-
it("supports asynchronous functions, only advancing to next function after a done() callback", function() {
|
49
|
-
//TODO: it would be nice if spy arity could match the fake, so we could do something like:
|
50
|
-
//createSpy('asyncfn').and.callFake(function(done) {});
|
51
|
-
|
52
|
-
var onComplete = jasmine.createSpy('onComplete'),
|
53
|
-
beforeCallback = jasmine.createSpy('beforeCallback'),
|
54
|
-
fnCallback = jasmine.createSpy('fnCallback'),
|
55
|
-
afterCallback = jasmine.createSpy('afterCallback'),
|
56
|
-
fn1 = function(done) {
|
57
|
-
beforeCallback();
|
58
|
-
setTimeout(done, 100);
|
59
|
-
},
|
60
|
-
fn2 = function(done) {
|
61
|
-
fnCallback();
|
62
|
-
setTimeout(done, 100);
|
63
|
-
},
|
64
|
-
fn3 = function(done) {
|
65
|
-
afterCallback();
|
66
|
-
setTimeout(done, 100);
|
67
|
-
},
|
68
|
-
queueRunner = new j$.QueueRunner({
|
69
|
-
fns: [fn1, fn2, fn3],
|
70
|
-
onComplete: onComplete
|
71
|
-
});
|
72
|
-
|
73
|
-
queueRunner.execute();
|
74
|
-
|
75
|
-
expect(beforeCallback).toHaveBeenCalled();
|
76
|
-
expect(fnCallback).not.toHaveBeenCalled();
|
77
|
-
expect(afterCallback).not.toHaveBeenCalled();
|
78
|
-
expect(onComplete).not.toHaveBeenCalled();
|
79
|
-
|
80
|
-
jasmine.clock().tick(100);
|
81
|
-
|
82
|
-
expect(fnCallback).toHaveBeenCalled();
|
83
|
-
expect(afterCallback).not.toHaveBeenCalled();
|
84
|
-
expect(onComplete).not.toHaveBeenCalled();
|
85
|
-
|
86
|
-
jasmine.clock().tick(100);
|
87
|
-
|
88
|
-
expect(afterCallback).toHaveBeenCalled();
|
89
|
-
expect(onComplete).not.toHaveBeenCalled();
|
90
|
-
|
91
|
-
jasmine.clock().tick(100);
|
92
|
-
|
93
|
-
expect(onComplete).toHaveBeenCalled();
|
94
|
-
});
|
95
|
-
|
96
|
-
it("sets a timeout if requested for asynchronous functions so they don't go on forever", function() {
|
97
|
-
var beforeFn = function(done) { },
|
98
|
-
fn = jasmine.createSpy('fn'),
|
99
|
-
onComplete = jasmine.createSpy('onComplete'),
|
100
|
-
onException = jasmine.createSpy('onException'),
|
101
|
-
queueRunner = new j$.QueueRunner({
|
102
|
-
fns: [beforeFn, fn],
|
103
|
-
onComplete: onComplete,
|
104
|
-
onException: onException,
|
105
|
-
enforceTimeout: function() { return true; }
|
106
|
-
});
|
107
|
-
|
108
|
-
queueRunner.execute();
|
109
|
-
expect(fn).not.toHaveBeenCalled();
|
110
|
-
|
111
|
-
jasmine.clock().tick(j$.DEFAULT_TIMEOUT_INTERVAL);
|
112
|
-
|
113
|
-
expect(onException).toHaveBeenCalledWith(jasmine.any(Error));
|
114
|
-
expect(fn).toHaveBeenCalled();
|
115
|
-
expect(onComplete).toHaveBeenCalled();
|
116
|
-
});
|
117
|
-
|
118
|
-
it("by default does not set a timeout for asynchronous functions", function() {
|
119
|
-
var beforeFn = function(done) { },
|
120
|
-
fn = jasmine.createSpy('fn'),
|
121
|
-
onComplete = jasmine.createSpy('onComplete'),
|
122
|
-
onException = jasmine.createSpy('onException'),
|
123
|
-
queueRunner = new j$.QueueRunner({
|
124
|
-
fns: [beforeFn, fn],
|
125
|
-
onComplete: onComplete,
|
126
|
-
onException: onException,
|
127
|
-
});
|
128
|
-
|
129
|
-
queueRunner.execute();
|
130
|
-
expect(fn).not.toHaveBeenCalled();
|
131
|
-
|
132
|
-
jasmine.clock().tick(j$.DEFAULT_TIMEOUT_INTERVAL);
|
133
|
-
|
134
|
-
expect(onException).not.toHaveBeenCalled();
|
135
|
-
expect(fn).not.toHaveBeenCalled();
|
136
|
-
expect(onComplete).not.toHaveBeenCalled();
|
137
|
-
});
|
138
|
-
|
139
|
-
it("clears the timeout when an async function throws an exception, to prevent additional onException calls", function() {
|
140
|
-
var fn = function(done) { throw new Error("error!"); },
|
141
|
-
onComplete = jasmine.createSpy('onComplete'),
|
142
|
-
onException = jasmine.createSpy('onException'),
|
143
|
-
queueRunner = new j$.QueueRunner({
|
144
|
-
fns: [fn],
|
145
|
-
onComplete: onComplete,
|
146
|
-
onException: onException
|
147
|
-
});
|
148
|
-
|
149
|
-
queueRunner.execute();
|
150
|
-
|
151
|
-
expect(onComplete).toHaveBeenCalled();
|
152
|
-
expect(onException).toHaveBeenCalled();
|
153
|
-
|
154
|
-
jasmine.clock().tick(j$.DEFAULT_TIMEOUT_INTERVAL);
|
155
|
-
expect(onException.calls.count()).toEqual(1);
|
156
|
-
});
|
157
|
-
|
158
|
-
it("clears the timeout when the done callback is called", function() {
|
159
|
-
var fn = function(done) { done(); },
|
160
|
-
onComplete = jasmine.createSpy('onComplete'),
|
161
|
-
onException = jasmine.createSpy('onException'),
|
162
|
-
queueRunner = new j$.QueueRunner({
|
163
|
-
fns: [fn],
|
164
|
-
onComplete: onComplete,
|
165
|
-
onException: onException
|
166
|
-
});
|
167
|
-
|
168
|
-
queueRunner.execute();
|
169
|
-
|
170
|
-
expect(onComplete).toHaveBeenCalled();
|
171
|
-
|
172
|
-
jasmine.clock().tick(j$.DEFAULT_TIMEOUT_INTERVAL);
|
173
|
-
expect(onException).not.toHaveBeenCalled();
|
174
|
-
});
|
175
|
-
|
176
|
-
it("only moves to the next spec the first time you call done", function() {
|
177
|
-
var fn = function(done) {done(); done();},
|
178
|
-
nextFn = jasmine.createSpy('nextFn');
|
179
|
-
queueRunner = new j$.QueueRunner({
|
180
|
-
fns: [fn, nextFn]
|
181
|
-
});
|
182
|
-
|
183
|
-
queueRunner.execute();
|
184
|
-
expect(nextFn.calls.count()).toEqual(1);
|
185
|
-
});
|
186
|
-
|
187
|
-
it("does not move to the next spec if done is called after an exception has ended the spec", function() {
|
188
|
-
var fn = function(done) {
|
189
|
-
setTimeout(done, 1);
|
190
|
-
throw new Error('error!');
|
191
|
-
},
|
192
|
-
nextFn = jasmine.createSpy('nextFn');
|
193
|
-
queueRunner = new j$.QueueRunner({
|
194
|
-
fns: [fn, nextFn]
|
195
|
-
});
|
196
|
-
|
197
|
-
queueRunner.execute();
|
198
|
-
jasmine.clock().tick(1);
|
199
|
-
expect(nextFn.calls.count()).toEqual(1);
|
200
|
-
});
|
201
|
-
});
|
202
|
-
|
203
|
-
it("calls an exception handler when an exception is thrown in a fn", function() {
|
204
|
-
var fn = function() {
|
205
|
-
throw new Error('fake error');
|
206
|
-
},
|
207
|
-
exceptionCallback = jasmine.createSpy('exception callback'),
|
208
|
-
queueRunner = new j$.QueueRunner({
|
209
|
-
fns: [fn],
|
210
|
-
onException: exceptionCallback
|
211
|
-
});
|
212
|
-
|
213
|
-
queueRunner.execute();
|
214
|
-
|
215
|
-
expect(exceptionCallback).toHaveBeenCalledWith(jasmine.any(Error));
|
216
|
-
});
|
217
|
-
|
218
|
-
it("rethrows an exception if told to", function() {
|
219
|
-
var fn = function() {
|
220
|
-
throw new Error('fake error');
|
221
|
-
},
|
222
|
-
queueRunner = new j$.QueueRunner({
|
223
|
-
fns: [fn],
|
224
|
-
catchException: function(e) { return false; }
|
225
|
-
});
|
226
|
-
|
227
|
-
expect(queueRunner.execute).toThrow();
|
228
|
-
});
|
229
|
-
|
230
|
-
it("continues running the functions even after an exception is thrown in an async spec", function() {
|
231
|
-
var fn = function(done) { throw new Error("error"); },
|
232
|
-
nextFn = jasmine.createSpy("nextFunction"),
|
233
|
-
queueRunner = new j$.QueueRunner({
|
234
|
-
fns: [fn, nextFn]
|
235
|
-
});
|
236
|
-
|
237
|
-
queueRunner.execute();
|
238
|
-
expect(nextFn).toHaveBeenCalled();
|
239
|
-
});
|
240
|
-
|
241
|
-
it("calls a provided complete callback when done", function() {
|
242
|
-
var fn = jasmine.createSpy('fn'),
|
243
|
-
completeCallback = jasmine.createSpy('completeCallback'),
|
244
|
-
queueRunner = new j$.QueueRunner({
|
245
|
-
fns: [fn],
|
246
|
-
onComplete: completeCallback
|
247
|
-
});
|
248
|
-
|
249
|
-
queueRunner.execute();
|
250
|
-
|
251
|
-
expect(completeCallback).toHaveBeenCalled();
|
252
|
-
});
|
253
|
-
|
254
|
-
it("calls a provided stack clearing function when done", function() {
|
255
|
-
var asyncFn = function(done) { done() },
|
256
|
-
afterFn = jasmine.createSpy('afterFn'),
|
257
|
-
completeCallback = jasmine.createSpy('completeCallback'),
|
258
|
-
clearStack = jasmine.createSpy('clearStack'),
|
259
|
-
queueRunner = new j$.QueueRunner({
|
260
|
-
fns: [asyncFn, afterFn],
|
261
|
-
clearStack: clearStack,
|
262
|
-
onComplete: completeCallback
|
263
|
-
});
|
264
|
-
|
265
|
-
clearStack.and.callFake(function(fn) { fn(); });
|
266
|
-
|
267
|
-
queueRunner.execute();
|
268
|
-
expect(afterFn).toHaveBeenCalled();
|
269
|
-
expect(clearStack).toHaveBeenCalledWith(completeCallback);
|
270
|
-
});
|
271
|
-
});
|
@@ -1,40 +0,0 @@
|
|
1
|
-
describe("ReportDispatcher", function() {
|
2
|
-
|
3
|
-
it("builds an interface of requested methods", function() {
|
4
|
-
var dispatcher = new j$.ReportDispatcher(['foo', 'bar', 'baz']);
|
5
|
-
|
6
|
-
expect(dispatcher.foo).toBeDefined();
|
7
|
-
expect(dispatcher.bar).toBeDefined();
|
8
|
-
expect(dispatcher.baz).toBeDefined();
|
9
|
-
});
|
10
|
-
|
11
|
-
it("dispatches requested methods to added reporters", function() {
|
12
|
-
var dispatcher = new j$.ReportDispatcher(['foo', 'bar']),
|
13
|
-
reporter = jasmine.createSpyObj('reporter', ['foo', 'bar']),
|
14
|
-
anotherReporter = jasmine.createSpyObj('reporter', ['foo', 'bar']);
|
15
|
-
|
16
|
-
dispatcher.addReporter(reporter);
|
17
|
-
dispatcher.addReporter(anotherReporter);
|
18
|
-
|
19
|
-
dispatcher.foo(123, 456);
|
20
|
-
|
21
|
-
expect(reporter.foo).toHaveBeenCalledWith(123, 456);
|
22
|
-
expect(anotherReporter.foo).toHaveBeenCalledWith(123, 456);
|
23
|
-
|
24
|
-
dispatcher.bar('a', 'b');
|
25
|
-
|
26
|
-
expect(reporter.bar).toHaveBeenCalledWith('a', 'b');
|
27
|
-
expect(anotherReporter.bar).toHaveBeenCalledWith('a', 'b');
|
28
|
-
});
|
29
|
-
|
30
|
-
it("does not dispatch to a reporter if the reporter doesn't accept the method", function() {
|
31
|
-
var dispatcher = new j$.ReportDispatcher(['foo']),
|
32
|
-
reporter = jasmine.createSpyObj('reporter', ['baz']);
|
33
|
-
|
34
|
-
dispatcher.addReporter(reporter);
|
35
|
-
|
36
|
-
expect(function() {
|
37
|
-
dispatcher.foo(123, 456);
|
38
|
-
}).not.toThrow();
|
39
|
-
});
|
40
|
-
});
|
@@ -1,260 +0,0 @@
|
|
1
|
-
describe("Spec", function() {
|
2
|
-
|
3
|
-
it("#isPendingSpecException returns true for a pending spec exception", function() {
|
4
|
-
var e = new Error(j$.Spec.pendingSpecExceptionMessage);
|
5
|
-
|
6
|
-
expect(j$.Spec.isPendingSpecException(e)).toBe(true);
|
7
|
-
});
|
8
|
-
|
9
|
-
it("#isPendingSpecException returns true for a pending spec exception (even when FF bug is present)", function() {
|
10
|
-
var fakeError = {
|
11
|
-
toString: function() { return "Error: " + j$.Spec.pendingSpecExceptionMessage; }
|
12
|
-
};
|
13
|
-
|
14
|
-
expect(j$.Spec.isPendingSpecException(fakeError)).toBe(true);
|
15
|
-
});
|
16
|
-
|
17
|
-
it("#isPendingSpecException returns true for a pending spec exception", function() {
|
18
|
-
var e = new Error("foo");
|
19
|
-
|
20
|
-
expect(j$.Spec.isPendingSpecException(e)).toBe(false);
|
21
|
-
});
|
22
|
-
|
23
|
-
it("#isPendingSpecException returns false for thrown values that don't have toString", function() {
|
24
|
-
expect(j$.Spec.isPendingSpecException(void 0)).toBe(false);
|
25
|
-
});
|
26
|
-
|
27
|
-
it("delegates execution to a QueueRunner", function() {
|
28
|
-
var fakeQueueRunner = jasmine.createSpy('fakeQueueRunner'),
|
29
|
-
spec = new j$.Spec({
|
30
|
-
description: 'my test',
|
31
|
-
id: 'some-id',
|
32
|
-
fn: function() {},
|
33
|
-
queueRunnerFactory: fakeQueueRunner
|
34
|
-
});
|
35
|
-
|
36
|
-
spec.execute();
|
37
|
-
|
38
|
-
expect(fakeQueueRunner).toHaveBeenCalled();
|
39
|
-
});
|
40
|
-
|
41
|
-
it("should call the start callback on execution", function() {
|
42
|
-
var fakeQueueRunner = jasmine.createSpy('fakeQueueRunner'),
|
43
|
-
startCallback = jasmine.createSpy('startCallback'),
|
44
|
-
spec = new j$.Spec({
|
45
|
-
id: 123,
|
46
|
-
description: 'foo bar',
|
47
|
-
fn: function() {},
|
48
|
-
onStart: startCallback,
|
49
|
-
queueRunnerFactory: fakeQueueRunner
|
50
|
-
});
|
51
|
-
|
52
|
-
spec.execute();
|
53
|
-
|
54
|
-
// TODO: due to some issue with the Pretty Printer, this line fails, but the other two pass.
|
55
|
-
// This means toHaveBeenCalledWith on IE8 will always be broken.
|
56
|
-
|
57
|
-
// expect(startCallback).toHaveBeenCalledWith(spec);
|
58
|
-
expect(startCallback).toHaveBeenCalled();
|
59
|
-
expect(startCallback.calls.first().object).toEqual(spec);
|
60
|
-
});
|
61
|
-
|
62
|
-
it("should call the start callback on execution but before any befores are called", function() {
|
63
|
-
var fakeQueueRunner = jasmine.createSpy('fakeQueueRunner'),
|
64
|
-
beforesWereCalled = false,
|
65
|
-
startCallback = jasmine.createSpy('start-callback').and.callFake(function() {
|
66
|
-
expect(beforesWereCalled).toBe(false);
|
67
|
-
}),
|
68
|
-
spec = new j$.Spec({
|
69
|
-
fn: function() {},
|
70
|
-
beforeFns: function() {
|
71
|
-
return [function() {
|
72
|
-
beforesWereCalled = true
|
73
|
-
}]
|
74
|
-
},
|
75
|
-
onStart: startCallback,
|
76
|
-
queueRunnerFactory: fakeQueueRunner
|
77
|
-
});
|
78
|
-
|
79
|
-
spec.execute();
|
80
|
-
|
81
|
-
expect(startCallback).toHaveBeenCalled();
|
82
|
-
});
|
83
|
-
|
84
|
-
it("provides all before fns and after fns to be run", function() {
|
85
|
-
var fakeQueueRunner = jasmine.createSpy('fakeQueueRunner'),
|
86
|
-
before = jasmine.createSpy('before'),
|
87
|
-
after = jasmine.createSpy('after'),
|
88
|
-
fn = jasmine.createSpy('test body').and.callFake(function() {
|
89
|
-
expect(before).toHaveBeenCalled();
|
90
|
-
expect(after).not.toHaveBeenCalled();
|
91
|
-
}),
|
92
|
-
spec = new j$.Spec({
|
93
|
-
fn: fn,
|
94
|
-
beforeFns: function() {
|
95
|
-
return [before]
|
96
|
-
},
|
97
|
-
afterFns: function() {
|
98
|
-
return [after]
|
99
|
-
},
|
100
|
-
queueRunnerFactory: fakeQueueRunner
|
101
|
-
});
|
102
|
-
|
103
|
-
spec.execute();
|
104
|
-
|
105
|
-
var allSpecFns = fakeQueueRunner.calls.mostRecent().args[0].fns;
|
106
|
-
expect(allSpecFns).toEqual([before, fn, after]);
|
107
|
-
});
|
108
|
-
|
109
|
-
it("is marked pending if created without a function body", function() {
|
110
|
-
var fakeQueueRunner = jasmine.createSpy('fakeQueueRunner'),
|
111
|
-
|
112
|
-
startCallback = jasmine.createSpy('startCallback'),
|
113
|
-
resultCallback = jasmine.createSpy('resultCallback'),
|
114
|
-
spec = new j$.Spec({
|
115
|
-
onStart: startCallback,
|
116
|
-
fn: null,
|
117
|
-
resultCallback: resultCallback,
|
118
|
-
queueRunnerFactory: fakeQueueRunner
|
119
|
-
});
|
120
|
-
|
121
|
-
|
122
|
-
expect(spec.status()).toBe('pending');
|
123
|
-
});
|
124
|
-
|
125
|
-
it("can be disabled, but still calls callbacks", function() {
|
126
|
-
var fakeQueueRunner = jasmine.createSpy('fakeQueueRunner'),
|
127
|
-
startCallback = jasmine.createSpy('startCallback'),
|
128
|
-
specBody = jasmine.createSpy('specBody'),
|
129
|
-
resultCallback = jasmine.createSpy('resultCallback'),
|
130
|
-
spec = new j$.Spec({
|
131
|
-
onStart:startCallback,
|
132
|
-
fn: specBody,
|
133
|
-
resultCallback: resultCallback,
|
134
|
-
queueRunnerFactory: fakeQueueRunner
|
135
|
-
});
|
136
|
-
|
137
|
-
spec.disable();
|
138
|
-
|
139
|
-
expect(spec.status()).toBe('disabled');
|
140
|
-
|
141
|
-
spec.execute();
|
142
|
-
|
143
|
-
expect(fakeQueueRunner).not.toHaveBeenCalled();
|
144
|
-
expect(specBody).not.toHaveBeenCalled();
|
145
|
-
|
146
|
-
expect(startCallback).toHaveBeenCalled();
|
147
|
-
expect(resultCallback).toHaveBeenCalled();
|
148
|
-
});
|
149
|
-
|
150
|
-
it("can be marked pending, but still calls callbacks when executed", function() {
|
151
|
-
var fakeQueueRunner = jasmine.createSpy('fakeQueueRunner'),
|
152
|
-
startCallback = jasmine.createSpy('startCallback'),
|
153
|
-
resultCallback = jasmine.createSpy('resultCallback'),
|
154
|
-
spec = new j$.Spec({
|
155
|
-
onStart: startCallback,
|
156
|
-
resultCallback: resultCallback,
|
157
|
-
description: "with a spec",
|
158
|
-
getSpecName: function() {
|
159
|
-
return "a suite with a spec"
|
160
|
-
},
|
161
|
-
queueRunnerFactory: fakeQueueRunner
|
162
|
-
});
|
163
|
-
|
164
|
-
spec.pend();
|
165
|
-
|
166
|
-
expect(spec.status()).toBe('pending');
|
167
|
-
|
168
|
-
spec.execute();
|
169
|
-
|
170
|
-
expect(fakeQueueRunner).not.toHaveBeenCalled();
|
171
|
-
|
172
|
-
expect(startCallback).toHaveBeenCalled();
|
173
|
-
expect(resultCallback).toHaveBeenCalledWith({
|
174
|
-
id: spec.id,
|
175
|
-
status: 'pending',
|
176
|
-
description: 'with a spec',
|
177
|
-
fullName: 'a suite with a spec',
|
178
|
-
failedExpectations: [],
|
179
|
-
passedExpectations: []
|
180
|
-
});
|
181
|
-
});
|
182
|
-
|
183
|
-
it("should call the done callback on execution complete", function() {
|
184
|
-
var done = jasmine.createSpy('done callback'),
|
185
|
-
spec = new j$.Spec({
|
186
|
-
fn: function() {},
|
187
|
-
catchExceptions: function() { return false; },
|
188
|
-
resultCallback: function() {},
|
189
|
-
queueRunnerFactory: function(attrs) { attrs.onComplete(); }
|
190
|
-
});
|
191
|
-
|
192
|
-
spec.execute(done);
|
193
|
-
|
194
|
-
expect(done).toHaveBeenCalled();
|
195
|
-
});
|
196
|
-
|
197
|
-
it("#status returns passing by default", function(){
|
198
|
-
var spec = new j$.Spec({ fn: function () {} });
|
199
|
-
expect(spec.status()).toBe("passed");
|
200
|
-
});
|
201
|
-
|
202
|
-
it("#status returns passed if all expectations in the spec have passed", function() {
|
203
|
-
var spec = new j$.Spec({fn: jasmine.createSpy("spec body")});
|
204
|
-
spec.addExpectationResult(true);
|
205
|
-
expect(spec.status()).toBe('passed');
|
206
|
-
});
|
207
|
-
|
208
|
-
it("#status returns failed if any expectations in the spec have failed", function() {
|
209
|
-
var spec = new j$.Spec({ fn: jasmine.createSpy("spec body") });
|
210
|
-
spec.addExpectationResult(true);
|
211
|
-
spec.addExpectationResult(false);
|
212
|
-
expect(spec.status()).toBe('failed');
|
213
|
-
});
|
214
|
-
|
215
|
-
it("keeps track of passed and failed expectations", function() {
|
216
|
-
var resultCallback = jasmine.createSpy('resultCallback'),
|
217
|
-
spec = new j$.Spec({
|
218
|
-
fn: jasmine.createSpy("spec body"),
|
219
|
-
expectationResultFactory: function (data) { return data; },
|
220
|
-
queueRunnerFactory: function(attrs) { attrs.onComplete(); },
|
221
|
-
resultCallback: resultCallback
|
222
|
-
});
|
223
|
-
spec.addExpectationResult(true, 'expectation1');
|
224
|
-
spec.addExpectationResult(false, 'expectation2');
|
225
|
-
|
226
|
-
spec.execute();
|
227
|
-
|
228
|
-
expect(resultCallback.calls.first().args[0].passedExpectations).toEqual(['expectation1']);
|
229
|
-
expect(resultCallback.calls.first().args[0].failedExpectations).toEqual(['expectation2']);
|
230
|
-
});
|
231
|
-
|
232
|
-
it("can return its full name", function() {
|
233
|
-
var specNameSpy = jasmine.createSpy('specNameSpy').and.returnValue('expected val');
|
234
|
-
|
235
|
-
var spec = new j$.Spec({
|
236
|
-
getSpecName: specNameSpy
|
237
|
-
});
|
238
|
-
|
239
|
-
expect(spec.getFullName()).toBe('expected val');
|
240
|
-
expect(specNameSpy.calls.mostRecent().args[0].id).toEqual(spec.id);
|
241
|
-
});
|
242
|
-
|
243
|
-
describe("when a spec is marked pending during execution", function() {
|
244
|
-
it("should mark the spec as pending", function() {
|
245
|
-
var fakeQueueRunner = function(opts) {
|
246
|
-
opts.onException(new Error(j$.Spec.pendingSpecExceptionMessage));
|
247
|
-
},
|
248
|
-
spec = new j$.Spec({
|
249
|
-
description: 'my test',
|
250
|
-
id: 'some-id',
|
251
|
-
fn: function() { },
|
252
|
-
queueRunnerFactory: fakeQueueRunner
|
253
|
-
});
|
254
|
-
|
255
|
-
spec.execute();
|
256
|
-
|
257
|
-
expect(spec.status()).toEqual("pending");
|
258
|
-
});
|
259
|
-
});
|
260
|
-
});
|
@@ -1,67 +0,0 @@
|
|
1
|
-
describe('Spies', function () {
|
2
|
-
describe("createSpy", function() {
|
3
|
-
var TestClass;
|
4
|
-
|
5
|
-
beforeEach(function() {
|
6
|
-
TestClass = function() {};
|
7
|
-
TestClass.prototype.someFunction = function() {};
|
8
|
-
TestClass.prototype.someFunction.bob = "test";
|
9
|
-
});
|
10
|
-
|
11
|
-
it("preserves the properties of the spied function", function() {
|
12
|
-
var spy = j$.createSpy(TestClass.prototype, TestClass.prototype.someFunction);
|
13
|
-
|
14
|
-
expect(spy.bob).toEqual("test");
|
15
|
-
});
|
16
|
-
|
17
|
-
it("warns the user that we intend to overwrite an existing property", function() {
|
18
|
-
TestClass.prototype.someFunction.and = "turkey";
|
19
|
-
|
20
|
-
expect(function() {
|
21
|
-
j$.createSpy(TestClass.prototype, TestClass.prototype.someFunction);
|
22
|
-
}).toThrowError("Jasmine spies would overwrite the 'and' and 'calls' properties on the object being spied upon");
|
23
|
-
});
|
24
|
-
|
25
|
-
it("adds a spyStrategy and callTracker to the spy", function() {
|
26
|
-
var spy = j$.createSpy(TestClass.prototype, TestClass.prototype.someFunction);
|
27
|
-
|
28
|
-
expect(spy.and).toEqual(jasmine.any(j$.SpyStrategy));
|
29
|
-
expect(spy.calls).toEqual(jasmine.any(j$.CallTracker));
|
30
|
-
});
|
31
|
-
|
32
|
-
it("tracks the argument of calls", function () {
|
33
|
-
var spy = j$.createSpy(TestClass.prototype, TestClass.prototype.someFunction);
|
34
|
-
var trackSpy = spyOn(spy.calls, "track");
|
35
|
-
|
36
|
-
spy("arg");
|
37
|
-
|
38
|
-
expect(trackSpy.calls.mostRecent().args[0].args).toEqual(["arg"]);
|
39
|
-
});
|
40
|
-
|
41
|
-
it("tracks the context of calls", function () {
|
42
|
-
var spy = j$.createSpy(TestClass.prototype, TestClass.prototype.someFunction);
|
43
|
-
var trackSpy = spyOn(spy.calls, "track");
|
44
|
-
|
45
|
-
var contextObject = { spyMethod: spy };
|
46
|
-
contextObject.spyMethod();
|
47
|
-
|
48
|
-
expect(trackSpy.calls.mostRecent().args[0].object).toEqual(contextObject);
|
49
|
-
});
|
50
|
-
});
|
51
|
-
|
52
|
-
describe("createSpyObj", function() {
|
53
|
-
it("should create an object with a bunch of spy methods when you call jasmine.createSpyObj()", function() {
|
54
|
-
var spyObj = j$.createSpyObj('BaseName', ['method1', 'method2']);
|
55
|
-
|
56
|
-
expect(spyObj).toEqual({ method1: jasmine.any(Function), method2: jasmine.any(Function)});
|
57
|
-
expect(spyObj.method1.and.identity()).toEqual('BaseName.method1');
|
58
|
-
expect(spyObj.method2.and.identity()).toEqual('BaseName.method2');
|
59
|
-
});
|
60
|
-
|
61
|
-
it("should throw if you do not pass an array argument", function() {
|
62
|
-
expect(function() {
|
63
|
-
j$.createSpyObj('BaseName');
|
64
|
-
}).toThrow("createSpyObj requires a non-empty array of method names to create spies for");
|
65
|
-
});
|
66
|
-
});
|
67
|
-
});
|