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,37 +0,0 @@
|
|
1
|
-
describe("toBeNaN", function() {
|
2
|
-
it("passes for NaN with a custom .not fail", function() {
|
3
|
-
var matcher = j$.matchers.toBeNaN(),
|
4
|
-
result;
|
5
|
-
|
6
|
-
result = matcher.compare(Number.NaN);
|
7
|
-
expect(result.pass).toBe(true);
|
8
|
-
expect(result.message).toEqual("Expected actual not to be NaN.");
|
9
|
-
});
|
10
|
-
|
11
|
-
it("fails for anything not a NaN", function() {
|
12
|
-
var matcher = j$.matchers.toBeNaN(),
|
13
|
-
result;
|
14
|
-
|
15
|
-
result = matcher.compare(1);
|
16
|
-
expect(result.pass).toBe(false);
|
17
|
-
|
18
|
-
result = matcher.compare(null);
|
19
|
-
expect(result.pass).toBe(false);
|
20
|
-
|
21
|
-
result = matcher.compare(void 0);
|
22
|
-
expect(result.pass).toBe(false);
|
23
|
-
|
24
|
-
result = matcher.compare('');
|
25
|
-
expect(result.pass).toBe(false);
|
26
|
-
|
27
|
-
result = matcher.compare(Number.POSITIVE_INFINITY);
|
28
|
-
expect(result.pass).toBe(false);
|
29
|
-
});
|
30
|
-
|
31
|
-
it("has a custom message on failure", function() {
|
32
|
-
var matcher = j$.matchers.toBeNaN(),
|
33
|
-
result = matcher.compare(0);
|
34
|
-
|
35
|
-
expect(result.message()).toEqual("Expected 0 to be NaN.");
|
36
|
-
});
|
37
|
-
});
|
@@ -1,17 +0,0 @@
|
|
1
|
-
describe("toBeNull", function() {
|
2
|
-
it("passes for null", function() {
|
3
|
-
var matcher = j$.matchers.toBeNull(),
|
4
|
-
result;
|
5
|
-
|
6
|
-
result = matcher.compare(null);
|
7
|
-
expect(result.pass).toBe(true);
|
8
|
-
});
|
9
|
-
|
10
|
-
it("fails for non-null", function() {
|
11
|
-
var matcher = j$.matchers.toBeNull(),
|
12
|
-
result;
|
13
|
-
|
14
|
-
result = matcher.compare('foo');
|
15
|
-
expect(result.pass).toBe(false);
|
16
|
-
});
|
17
|
-
});
|
@@ -1,17 +0,0 @@
|
|
1
|
-
describe("toBe", function() {
|
2
|
-
it("passes when actual === expected", function() {
|
3
|
-
var matcher = j$.matchers.toBe(),
|
4
|
-
result;
|
5
|
-
|
6
|
-
result = matcher.compare(1, 1);
|
7
|
-
expect(result.pass).toBe(true);
|
8
|
-
});
|
9
|
-
|
10
|
-
it("fails when actual !== expected", function() {
|
11
|
-
var matcher = j$.matchers.toBe(),
|
12
|
-
result;
|
13
|
-
|
14
|
-
result = matcher.compare(1, 2);
|
15
|
-
expect(result.pass).toBe(false);
|
16
|
-
});
|
17
|
-
});
|
@@ -1,38 +0,0 @@
|
|
1
|
-
describe("toBeTruthy", function() {
|
2
|
-
it("passes for 'truthy' values", function() {
|
3
|
-
var matcher = j$.matchers.toBeTruthy(),
|
4
|
-
result;
|
5
|
-
|
6
|
-
result = matcher.compare(true);
|
7
|
-
expect(result.pass).toBe(true);
|
8
|
-
|
9
|
-
result = matcher.compare(1);
|
10
|
-
expect(result.pass).toBe(true);
|
11
|
-
|
12
|
-
result = matcher.compare("foo");
|
13
|
-
expect(result.pass).toBe(true);
|
14
|
-
|
15
|
-
result = matcher.compare({});
|
16
|
-
expect(result.pass).toBe(true);
|
17
|
-
});
|
18
|
-
|
19
|
-
it("fails for 'falsy' values", function() {
|
20
|
-
var matcher = j$.matchers.toBeTruthy(),
|
21
|
-
result;
|
22
|
-
|
23
|
-
result = matcher.compare(false);
|
24
|
-
expect(result.pass).toBe(false);
|
25
|
-
|
26
|
-
result = matcher.compare(0);
|
27
|
-
expect(result.pass).toBe(false);
|
28
|
-
|
29
|
-
result = matcher.compare('');
|
30
|
-
expect(result.pass).toBe(false);
|
31
|
-
|
32
|
-
result = matcher.compare(null);
|
33
|
-
expect(result.pass).toBe(false);
|
34
|
-
|
35
|
-
result = matcher.compare(void 0);
|
36
|
-
expect(result.pass).toBe(false);
|
37
|
-
});
|
38
|
-
});
|
data/spec_app/vendor/assets/bower_components/jasmine/spec/core/matchers/toBeUndefinedSpec.js
DELETED
@@ -1,18 +0,0 @@
|
|
1
|
-
describe("toBeUndefined", function() {
|
2
|
-
it("passes for undefined values", function() {
|
3
|
-
var matcher = j$.matchers.toBeUndefined(),
|
4
|
-
result;
|
5
|
-
|
6
|
-
result = matcher.compare(void 0);
|
7
|
-
expect(result.pass).toBe(true);
|
8
|
-
|
9
|
-
});
|
10
|
-
|
11
|
-
it("fails when matching defined values", function() {
|
12
|
-
var matcher = j$.matchers.toBeUndefined(),
|
13
|
-
result;
|
14
|
-
|
15
|
-
result = matcher.compare('foo');
|
16
|
-
expect(result.pass).toBe(false);
|
17
|
-
})
|
18
|
-
});
|
@@ -1,26 +0,0 @@
|
|
1
|
-
describe("toContain", function() {
|
2
|
-
it("delegates to j$.matchersUtil.contains", function() {
|
3
|
-
var util = {
|
4
|
-
contains: jasmine.createSpy('delegated-contains').and.returnValue(true)
|
5
|
-
},
|
6
|
-
matcher = j$.matchers.toContain(util),
|
7
|
-
result;
|
8
|
-
|
9
|
-
result = matcher.compare("ABC", "B");
|
10
|
-
expect(util.contains).toHaveBeenCalledWith("ABC", "B", []);
|
11
|
-
expect(result.pass).toBe(true);
|
12
|
-
});
|
13
|
-
|
14
|
-
it("delegates to j$.matchersUtil.contains, passing in equality testers if present", function() {
|
15
|
-
var util = {
|
16
|
-
contains: jasmine.createSpy('delegated-contains').and.returnValue(true)
|
17
|
-
},
|
18
|
-
customEqualityTesters = ['a', 'b'],
|
19
|
-
matcher = j$.matchers.toContain(util, customEqualityTesters),
|
20
|
-
result;
|
21
|
-
|
22
|
-
result = matcher.compare("ABC", "B");
|
23
|
-
expect(util.contains).toHaveBeenCalledWith("ABC", "B", ['a', 'b']);
|
24
|
-
expect(result.pass).toBe(true);
|
25
|
-
});
|
26
|
-
});
|
@@ -1,28 +0,0 @@
|
|
1
|
-
describe("toEqual", function() {
|
2
|
-
it("delegates to equals function", function() {
|
3
|
-
var util = {
|
4
|
-
equals: jasmine.createSpy('delegated-equals').and.returnValue(true)
|
5
|
-
},
|
6
|
-
matcher = j$.matchers.toEqual(util),
|
7
|
-
result;
|
8
|
-
|
9
|
-
result = matcher.compare(1, 1);
|
10
|
-
|
11
|
-
expect(util.equals).toHaveBeenCalledWith(1, 1, []);
|
12
|
-
expect(result.pass).toBe(true);
|
13
|
-
});
|
14
|
-
|
15
|
-
it("delegates custom equality testers, if present", function() {
|
16
|
-
var util = {
|
17
|
-
equals: jasmine.createSpy('delegated-equals').and.returnValue(true)
|
18
|
-
},
|
19
|
-
customEqualityTesters = ['a', 'b'],
|
20
|
-
matcher = j$.matchers.toEqual(util, customEqualityTesters),
|
21
|
-
result;
|
22
|
-
|
23
|
-
result = matcher.compare(1, 1);
|
24
|
-
|
25
|
-
expect(util.equals).toHaveBeenCalledWith(1, 1, ['a', 'b']);
|
26
|
-
expect(result.pass).toBe(true);
|
27
|
-
});
|
28
|
-
});
|
data/spec_app/vendor/assets/bower_components/jasmine/spec/core/matchers/toHaveBeenCalledSpec.js
DELETED
@@ -1,47 +0,0 @@
|
|
1
|
-
describe("toHaveBeenCalled", function() {
|
2
|
-
it("passes when the actual was called, with a custom .not fail message", function() {
|
3
|
-
var matcher = j$.matchers.toHaveBeenCalled(),
|
4
|
-
calledSpy = j$.createSpy('called-spy'),
|
5
|
-
result;
|
6
|
-
|
7
|
-
calledSpy();
|
8
|
-
|
9
|
-
result = matcher.compare(calledSpy);
|
10
|
-
expect(result.pass).toBe(true);
|
11
|
-
expect(result.message).toEqual("Expected spy called-spy not to have been called.");
|
12
|
-
});
|
13
|
-
|
14
|
-
it("fails when the actual was not called", function() {
|
15
|
-
var matcher = j$.matchers.toHaveBeenCalled(),
|
16
|
-
uncalledSpy = j$.createSpy('uncalled spy'),
|
17
|
-
result;
|
18
|
-
|
19
|
-
result = matcher.compare(uncalledSpy);
|
20
|
-
expect(result.pass).toBe(false);
|
21
|
-
});
|
22
|
-
|
23
|
-
it("throws an exception when the actual is not a spy", function() {
|
24
|
-
var matcher = j$.matchers.toHaveBeenCalled(),
|
25
|
-
fn = function() {};
|
26
|
-
|
27
|
-
expect(function() { matcher.compare(fn) }).toThrow(new Error("Expected a spy, but got Function."));
|
28
|
-
});
|
29
|
-
|
30
|
-
it("throws an exception when invoked with any arguments", function() {
|
31
|
-
var matcher = j$.matchers.toHaveBeenCalled(),
|
32
|
-
spy = j$.createSpy('sample spy');
|
33
|
-
|
34
|
-
expect(function() { matcher.compare(spy, 'foo') }).toThrow(new Error("toHaveBeenCalled does not take arguments, use toHaveBeenCalledWith"));
|
35
|
-
});
|
36
|
-
|
37
|
-
it("has a custom message on failure", function() {
|
38
|
-
var matcher = j$.matchers.toHaveBeenCalled(),
|
39
|
-
spy = j$.createSpy('sample-spy'),
|
40
|
-
result;
|
41
|
-
|
42
|
-
result = matcher.compare(spy);
|
43
|
-
|
44
|
-
expect(result.message).toEqual("Expected spy sample-spy to have been called.");
|
45
|
-
});
|
46
|
-
});
|
47
|
-
|
data/spec_app/vendor/assets/bower_components/jasmine/spec/core/matchers/toHaveBeenCalledWithSpec.js
DELETED
@@ -1,66 +0,0 @@
|
|
1
|
-
describe("toHaveBeenCalledWith", function() {
|
2
|
-
it("passes when the actual was called with matching parameters", function() {
|
3
|
-
var util = {
|
4
|
-
contains: jasmine.createSpy('delegated-contains').and.returnValue(true)
|
5
|
-
},
|
6
|
-
matcher = j$.matchers.toHaveBeenCalledWith(util),
|
7
|
-
calledSpy = j$.createSpy('called-spy'),
|
8
|
-
result;
|
9
|
-
|
10
|
-
calledSpy('a', 'b');
|
11
|
-
result = matcher.compare(calledSpy, 'a', 'b');
|
12
|
-
|
13
|
-
expect(result.pass).toBe(true);
|
14
|
-
expect(result.message()).toEqual("Expected spy called-spy not to have been called with [ 'a', 'b' ] but it was.");
|
15
|
-
});
|
16
|
-
|
17
|
-
it("passes through the custom equality testers", function() {
|
18
|
-
var util = {
|
19
|
-
contains: jasmine.createSpy('delegated-contains').and.returnValue(true)
|
20
|
-
},
|
21
|
-
customEqualityTesters = [function() { return true; }],
|
22
|
-
matcher = j$.matchers.toHaveBeenCalledWith(util, customEqualityTesters),
|
23
|
-
calledSpy = j$.createSpy('called-spy');
|
24
|
-
|
25
|
-
calledSpy('a', 'b');
|
26
|
-
matcher.compare(calledSpy, 'a', 'b');
|
27
|
-
|
28
|
-
expect(util.contains).toHaveBeenCalledWith([['a', 'b']], ['a', 'b'], customEqualityTesters);
|
29
|
-
});
|
30
|
-
|
31
|
-
it("fails when the actual was not called", function() {
|
32
|
-
var util = {
|
33
|
-
contains: jasmine.createSpy('delegated-contains').and.returnValue(false)
|
34
|
-
},
|
35
|
-
matcher = j$.matchers.toHaveBeenCalledWith(util),
|
36
|
-
uncalledSpy = j$.createSpy('uncalled spy'),
|
37
|
-
result;
|
38
|
-
|
39
|
-
result = matcher.compare(uncalledSpy);
|
40
|
-
expect(result.pass).toBe(false);
|
41
|
-
expect(result.message()).toEqual("Expected spy uncalled spy to have been called with [ ] but it was never called.");
|
42
|
-
});
|
43
|
-
|
44
|
-
it("fails when the actual was called with different parameters", function() {
|
45
|
-
var util = {
|
46
|
-
contains: jasmine.createSpy('delegated-contains').and.returnValue(false)
|
47
|
-
},
|
48
|
-
matcher = j$.matchers.toHaveBeenCalledWith(util),
|
49
|
-
calledSpy = j$.createSpy('called spy'),
|
50
|
-
result;
|
51
|
-
|
52
|
-
calledSpy('a');
|
53
|
-
calledSpy('c', 'd');
|
54
|
-
result = matcher.compare(calledSpy, 'a', 'b');
|
55
|
-
|
56
|
-
expect(result.pass).toBe(false);
|
57
|
-
expect(result.message()).toEqual("Expected spy called spy to have been called with [ 'a', 'b' ] but actual calls were [ 'a' ], [ 'c', 'd' ].");
|
58
|
-
});
|
59
|
-
|
60
|
-
it("throws an exception when the actual is not a spy", function() {
|
61
|
-
var matcher = j$.matchers.toHaveBeenCalledWith(),
|
62
|
-
fn = function() {};
|
63
|
-
|
64
|
-
expect(function() { matcher.compare(fn) }).toThrow(new Error("Expected a spy, but got Function."));
|
65
|
-
});
|
66
|
-
});
|
@@ -1,34 +0,0 @@
|
|
1
|
-
describe("toMatch", function() {
|
2
|
-
it("passes when RegExps are equivalent", function() {
|
3
|
-
var matcher = j$.matchers.toMatch(),
|
4
|
-
result;
|
5
|
-
|
6
|
-
result = matcher.compare(/foo/, /foo/);
|
7
|
-
expect(result.pass).toBe(true);
|
8
|
-
});
|
9
|
-
|
10
|
-
it("fails when RegExps are not equivalent", function() {
|
11
|
-
var matcher = j$.matchers.toMatch(),
|
12
|
-
result;
|
13
|
-
|
14
|
-
result = matcher.compare(/bar/, /foo/);
|
15
|
-
expect(result.pass).toBe(false);
|
16
|
-
});
|
17
|
-
|
18
|
-
it("passes when the actual matches the expected string as a pattern", function() {
|
19
|
-
var matcher = j$.matchers.toMatch(),
|
20
|
-
result;
|
21
|
-
|
22
|
-
result = matcher.compare('foosball', 'foo');
|
23
|
-
expect(result.pass).toBe(true);
|
24
|
-
});
|
25
|
-
|
26
|
-
it("fails when the actual matches the expected string as a pattern", function() {
|
27
|
-
var matcher = j$.matchers.toMatch(),
|
28
|
-
result;
|
29
|
-
|
30
|
-
result = matcher.compare('bar', 'foo');
|
31
|
-
expect(result.pass).toBe(false);
|
32
|
-
});
|
33
|
-
});
|
34
|
-
|
@@ -1,280 +0,0 @@
|
|
1
|
-
describe("toThrowError", function() {
|
2
|
-
it("throws an error when the actual is not a function", function() {
|
3
|
-
var matcher = j$.matchers.toThrowError();
|
4
|
-
|
5
|
-
expect(function() {
|
6
|
-
matcher.compare({});
|
7
|
-
}).toThrowError("Actual is not a Function");
|
8
|
-
});
|
9
|
-
|
10
|
-
it("throws an error when the expected is not an Error, string, or RegExp", function() {
|
11
|
-
var matcher = j$.matchers.toThrowError(),
|
12
|
-
fn = function() {
|
13
|
-
throw new Error("foo");
|
14
|
-
};
|
15
|
-
|
16
|
-
expect(function() {
|
17
|
-
matcher.compare(fn, 1);
|
18
|
-
}).toThrowError("Expected is not an Error, string, or RegExp.");
|
19
|
-
});
|
20
|
-
|
21
|
-
it("throws an error when the expected error type is not an Error", function() {
|
22
|
-
var matcher = j$.matchers.toThrowError(),
|
23
|
-
fn = function() {
|
24
|
-
throw new Error("foo");
|
25
|
-
};
|
26
|
-
|
27
|
-
expect(function() {
|
28
|
-
matcher.compare(fn, void 0, "foo");
|
29
|
-
}).toThrowError("Expected error type is not an Error.");
|
30
|
-
});
|
31
|
-
|
32
|
-
it("throws an error when the expected error message is not a string or RegExp", function() {
|
33
|
-
var matcher = j$.matchers.toThrowError(),
|
34
|
-
fn = function() {
|
35
|
-
throw new Error("foo");
|
36
|
-
};
|
37
|
-
|
38
|
-
expect(function() {
|
39
|
-
matcher.compare(fn, Error, 1);
|
40
|
-
}).toThrowError("Expected error message is not a string or RegExp.");
|
41
|
-
});
|
42
|
-
|
43
|
-
it("fails if actual does not throw at all", function() {
|
44
|
-
var matcher = j$.matchers.toThrowError(),
|
45
|
-
fn = function() {
|
46
|
-
return true;
|
47
|
-
},
|
48
|
-
result;
|
49
|
-
|
50
|
-
result = matcher.compare(fn);
|
51
|
-
|
52
|
-
expect(result.pass).toBe(false);
|
53
|
-
expect(result.message).toEqual("Expected function to throw an Error.");
|
54
|
-
});
|
55
|
-
|
56
|
-
it("fails if thrown is not an instanceof Error", function() {
|
57
|
-
var matcher = j$.matchers.toThrowError(),
|
58
|
-
fn = function() {
|
59
|
-
throw 4;
|
60
|
-
},
|
61
|
-
result;
|
62
|
-
|
63
|
-
result = matcher.compare(fn);
|
64
|
-
expect(result.pass).toBe(false);
|
65
|
-
expect(result.message()).toEqual("Expected function to throw an Error, but it threw 4.");
|
66
|
-
});
|
67
|
-
|
68
|
-
it("fails with the correct message if thrown is a falsy value", function() {
|
69
|
-
var matcher = j$.matchers.toThrowError(),
|
70
|
-
fn = function() {
|
71
|
-
throw undefined;
|
72
|
-
},
|
73
|
-
result;
|
74
|
-
|
75
|
-
result = matcher.compare(fn);
|
76
|
-
expect(result.pass).toBe(false);
|
77
|
-
expect(result.message()).toEqual("Expected function to throw an Error, but it threw undefined.");
|
78
|
-
});
|
79
|
-
|
80
|
-
it("passes if thrown is a type of Error, but there is no expected error", function() {
|
81
|
-
var matcher = j$.matchers.toThrowError(),
|
82
|
-
fn = function() {
|
83
|
-
throw new TypeError();
|
84
|
-
},
|
85
|
-
result;
|
86
|
-
|
87
|
-
result = matcher.compare(fn);
|
88
|
-
|
89
|
-
expect(result.pass).toBe(true);
|
90
|
-
expect(result.message).toEqual("Expected function not to throw an Error, but it threw TypeError.");
|
91
|
-
});
|
92
|
-
|
93
|
-
it("passes if thrown is an Error and the expected is the same message", function() {
|
94
|
-
var matcher = j$.matchers.toThrowError(),
|
95
|
-
fn = function() {
|
96
|
-
throw new Error("foo");
|
97
|
-
},
|
98
|
-
result;
|
99
|
-
|
100
|
-
result = matcher.compare(fn, "foo");
|
101
|
-
|
102
|
-
expect(result.pass).toBe(true);
|
103
|
-
expect(result.message()).toEqual("Expected function not to throw an exception with message 'foo'.");
|
104
|
-
});
|
105
|
-
|
106
|
-
it("fails if thrown is an Error and the expected is not the same message", function() {
|
107
|
-
var matcher = j$.matchers.toThrowError(),
|
108
|
-
fn = function() {
|
109
|
-
throw new Error("foo");
|
110
|
-
},
|
111
|
-
result;
|
112
|
-
|
113
|
-
result = matcher.compare(fn, "bar");
|
114
|
-
|
115
|
-
expect(result.pass).toBe(false);
|
116
|
-
expect(result.message()).toEqual("Expected function to throw an exception with message 'bar', but it threw an exception with message 'foo'.");
|
117
|
-
});
|
118
|
-
|
119
|
-
it("passes if thrown is an Error and the expected is a RegExp that matches the message", function() {
|
120
|
-
var matcher = j$.matchers.toThrowError(),
|
121
|
-
fn = function() {
|
122
|
-
throw new Error("a long message");
|
123
|
-
},
|
124
|
-
result;
|
125
|
-
|
126
|
-
result = matcher.compare(fn, /long/);
|
127
|
-
|
128
|
-
expect(result.pass).toBe(true);
|
129
|
-
expect(result.message()).toEqual("Expected function not to throw an exception with a message matching /long/.");
|
130
|
-
});
|
131
|
-
|
132
|
-
it("fails if thrown is an Error and the expected is a RegExp that does not match the message", function() {
|
133
|
-
var matcher = j$.matchers.toThrowError(),
|
134
|
-
fn = function() {
|
135
|
-
throw new Error("a long message");
|
136
|
-
},
|
137
|
-
result;
|
138
|
-
|
139
|
-
result = matcher.compare(fn, /foo/);
|
140
|
-
|
141
|
-
expect(result.pass).toBe(false);
|
142
|
-
expect(result.message()).toEqual("Expected function to throw an exception with a message matching /foo/, but it threw an exception with message 'a long message'.");
|
143
|
-
});
|
144
|
-
|
145
|
-
it("passes if thrown is an Error and the expected the same Error", function() {
|
146
|
-
var util = {
|
147
|
-
equals: jasmine.createSpy('delegated-equal').and.returnValue(true)
|
148
|
-
},
|
149
|
-
matcher = j$.matchers.toThrowError(util),
|
150
|
-
fn = function() {
|
151
|
-
throw new Error();
|
152
|
-
},
|
153
|
-
result;
|
154
|
-
|
155
|
-
result = matcher.compare(fn, Error);
|
156
|
-
|
157
|
-
expect(result.pass).toBe(true);
|
158
|
-
expect(result.message).toEqual("Expected function not to throw Error.");
|
159
|
-
});
|
160
|
-
|
161
|
-
it("passes if thrown is a custom error that takes arguments and the expected is the same error", function() {
|
162
|
-
var util = {
|
163
|
-
equals: jasmine.createSpy('delegated-equal').and.returnValue(true)
|
164
|
-
},
|
165
|
-
matcher = j$.matchers.toThrowError(util),
|
166
|
-
CustomError = function CustomError(arg) { arg.x },
|
167
|
-
fn = function() {
|
168
|
-
throw new CustomError({ x: 1 });
|
169
|
-
},
|
170
|
-
result;
|
171
|
-
|
172
|
-
CustomError.prototype = new Error();
|
173
|
-
CustomError.prototype.constructor = CustomError;
|
174
|
-
|
175
|
-
result = matcher.compare(fn, CustomError);
|
176
|
-
|
177
|
-
expect(result.pass).toBe(true);
|
178
|
-
expect(result.message).toEqual("Expected function not to throw CustomError.");
|
179
|
-
});
|
180
|
-
|
181
|
-
it("fails if thrown is an Error and the expected is a different Error", function() {
|
182
|
-
var util = {
|
183
|
-
equals: jasmine.createSpy('delegated-equal').and.returnValue(false)
|
184
|
-
},
|
185
|
-
matcher = j$.matchers.toThrowError(util),
|
186
|
-
fn = function() {
|
187
|
-
throw new Error();
|
188
|
-
},
|
189
|
-
result;
|
190
|
-
|
191
|
-
result = matcher.compare(fn, TypeError);
|
192
|
-
|
193
|
-
expect(result.pass).toBe(false);
|
194
|
-
expect(result.message).toEqual("Expected function to throw TypeError, but it threw Error.");
|
195
|
-
});
|
196
|
-
|
197
|
-
it("passes if thrown is a type of Error and it is equal to the expected Error and message", function() {
|
198
|
-
var util = {
|
199
|
-
equals: jasmine.createSpy('delegated-equal').and.returnValue(true)
|
200
|
-
},
|
201
|
-
matcher = j$.matchers.toThrowError(util),
|
202
|
-
fn = function() {
|
203
|
-
throw new TypeError("foo");
|
204
|
-
},
|
205
|
-
result;
|
206
|
-
|
207
|
-
result = matcher.compare(fn, TypeError, "foo");
|
208
|
-
|
209
|
-
expect(result.pass).toBe(true);
|
210
|
-
expect(result.message()).toEqual("Expected function not to throw TypeError with message 'foo'.");
|
211
|
-
});
|
212
|
-
|
213
|
-
it("passes if thrown is a custom error that takes arguments and it is equal to the expected custom error and message", function() {
|
214
|
-
var util = {
|
215
|
-
equals: jasmine.createSpy('delegated-equal').and.returnValue(true)
|
216
|
-
},
|
217
|
-
matcher = j$.matchers.toThrowError(util),
|
218
|
-
CustomError = function CustomError(arg) { this.message = arg.message },
|
219
|
-
fn = function() {
|
220
|
-
throw new CustomError({message: "foo"});
|
221
|
-
},
|
222
|
-
result;
|
223
|
-
|
224
|
-
CustomError.prototype = new Error();
|
225
|
-
CustomError.prototype.constructor = CustomError;
|
226
|
-
|
227
|
-
result = matcher.compare(fn, CustomError, "foo");
|
228
|
-
|
229
|
-
expect(result.pass).toBe(true);
|
230
|
-
expect(result.message()).toEqual("Expected function not to throw CustomError with message 'foo'.");
|
231
|
-
});
|
232
|
-
|
233
|
-
it("fails if thrown is a type of Error and the expected is a different Error", function() {
|
234
|
-
var util = {
|
235
|
-
equals: jasmine.createSpy('delegated-equal').and.returnValue(false)
|
236
|
-
},
|
237
|
-
matcher = j$.matchers.toThrowError(util),
|
238
|
-
fn = function() {
|
239
|
-
throw new TypeError("foo");
|
240
|
-
},
|
241
|
-
result;
|
242
|
-
|
243
|
-
result = matcher.compare(fn, TypeError, "bar");
|
244
|
-
|
245
|
-
expect(result.pass).toBe(false);
|
246
|
-
expect(result.message()).toEqual("Expected function to throw TypeError with message 'bar', but it threw TypeError with message 'foo'.");
|
247
|
-
});
|
248
|
-
|
249
|
-
it("passes if thrown is a type of Error and has the same type as the expected Error and the message matches the expected message", function() {
|
250
|
-
var util = {
|
251
|
-
equals: jasmine.createSpy('delegated-equal').and.returnValue(true)
|
252
|
-
},
|
253
|
-
matcher = j$.matchers.toThrowError(util),
|
254
|
-
fn = function() {
|
255
|
-
throw new TypeError("foo");
|
256
|
-
},
|
257
|
-
result;
|
258
|
-
|
259
|
-
result = matcher.compare(fn, TypeError, /foo/);
|
260
|
-
|
261
|
-
expect(result.pass).toBe(true);
|
262
|
-
expect(result.message()).toEqual("Expected function not to throw TypeError with message matching /foo/.");
|
263
|
-
});
|
264
|
-
|
265
|
-
it("fails if thrown is a type of Error and the expected is a different Error", function() {
|
266
|
-
var util = {
|
267
|
-
equals: jasmine.createSpy('delegated-equal').and.returnValue(false)
|
268
|
-
},
|
269
|
-
matcher = j$.matchers.toThrowError(util),
|
270
|
-
fn = function() {
|
271
|
-
throw new TypeError("foo");
|
272
|
-
},
|
273
|
-
result;
|
274
|
-
|
275
|
-
result = matcher.compare(fn, TypeError, /bar/);
|
276
|
-
|
277
|
-
expect(result.pass).toBe(false);
|
278
|
-
expect(result.message()).toEqual("Expected function to throw TypeError with message matching /bar/, but it threw TypeError with message 'foo'.");
|
279
|
-
});
|
280
|
-
});
|