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,145 +0,0 @@
|
|
1
|
-
getJasmineRequireObj().DelayedFunctionScheduler = function() {
|
2
|
-
function DelayedFunctionScheduler() {
|
3
|
-
var self = this;
|
4
|
-
var scheduledLookup = [];
|
5
|
-
var scheduledFunctions = {};
|
6
|
-
var currentTime = 0;
|
7
|
-
var delayedFnCount = 0;
|
8
|
-
|
9
|
-
self.tick = function(millis) {
|
10
|
-
millis = millis || 0;
|
11
|
-
var endTime = currentTime + millis;
|
12
|
-
|
13
|
-
runScheduledFunctions(endTime);
|
14
|
-
currentTime = endTime;
|
15
|
-
};
|
16
|
-
|
17
|
-
self.scheduleFunction = function(funcToCall, millis, params, recurring, timeoutKey, runAtMillis) {
|
18
|
-
var f;
|
19
|
-
if (typeof(funcToCall) === 'string') {
|
20
|
-
/* jshint evil: true */
|
21
|
-
f = function() { return eval(funcToCall); };
|
22
|
-
/* jshint evil: false */
|
23
|
-
} else {
|
24
|
-
f = funcToCall;
|
25
|
-
}
|
26
|
-
|
27
|
-
millis = millis || 0;
|
28
|
-
timeoutKey = timeoutKey || ++delayedFnCount;
|
29
|
-
runAtMillis = runAtMillis || (currentTime + millis);
|
30
|
-
|
31
|
-
var funcToSchedule = {
|
32
|
-
runAtMillis: runAtMillis,
|
33
|
-
funcToCall: f,
|
34
|
-
recurring: recurring,
|
35
|
-
params: params,
|
36
|
-
timeoutKey: timeoutKey,
|
37
|
-
millis: millis
|
38
|
-
};
|
39
|
-
|
40
|
-
if (runAtMillis in scheduledFunctions) {
|
41
|
-
scheduledFunctions[runAtMillis].push(funcToSchedule);
|
42
|
-
} else {
|
43
|
-
scheduledFunctions[runAtMillis] = [funcToSchedule];
|
44
|
-
scheduledLookup.push(runAtMillis);
|
45
|
-
scheduledLookup.sort(function (a, b) {
|
46
|
-
return a - b;
|
47
|
-
});
|
48
|
-
}
|
49
|
-
|
50
|
-
return timeoutKey;
|
51
|
-
};
|
52
|
-
|
53
|
-
self.removeFunctionWithId = function(timeoutKey) {
|
54
|
-
for (var runAtMillis in scheduledFunctions) {
|
55
|
-
var funcs = scheduledFunctions[runAtMillis];
|
56
|
-
var i = indexOfFirstToPass(funcs, function (func) {
|
57
|
-
return func.timeoutKey === timeoutKey;
|
58
|
-
});
|
59
|
-
|
60
|
-
if (i > -1) {
|
61
|
-
if (funcs.length === 1) {
|
62
|
-
delete scheduledFunctions[runAtMillis];
|
63
|
-
deleteFromLookup(runAtMillis);
|
64
|
-
} else {
|
65
|
-
funcs.splice(i, 1);
|
66
|
-
}
|
67
|
-
|
68
|
-
// intervals get rescheduled when executed, so there's never more
|
69
|
-
// than a single scheduled function with a given timeoutKey
|
70
|
-
break;
|
71
|
-
}
|
72
|
-
}
|
73
|
-
};
|
74
|
-
|
75
|
-
self.reset = function() {
|
76
|
-
currentTime = 0;
|
77
|
-
scheduledLookup = [];
|
78
|
-
scheduledFunctions = {};
|
79
|
-
delayedFnCount = 0;
|
80
|
-
};
|
81
|
-
|
82
|
-
return self;
|
83
|
-
|
84
|
-
function indexOfFirstToPass(array, testFn) {
|
85
|
-
var index = -1;
|
86
|
-
|
87
|
-
for (var i = 0; i < array.length; ++i) {
|
88
|
-
if (testFn(array[i])) {
|
89
|
-
index = i;
|
90
|
-
break;
|
91
|
-
}
|
92
|
-
}
|
93
|
-
|
94
|
-
return index;
|
95
|
-
}
|
96
|
-
|
97
|
-
function deleteFromLookup(key) {
|
98
|
-
var value = Number(key);
|
99
|
-
var i = indexOfFirstToPass(scheduledLookup, function (millis) {
|
100
|
-
return millis === value;
|
101
|
-
});
|
102
|
-
|
103
|
-
if (i > -1) {
|
104
|
-
scheduledLookup.splice(i, 1);
|
105
|
-
}
|
106
|
-
}
|
107
|
-
|
108
|
-
function reschedule(scheduledFn) {
|
109
|
-
self.scheduleFunction(scheduledFn.funcToCall,
|
110
|
-
scheduledFn.millis,
|
111
|
-
scheduledFn.params,
|
112
|
-
true,
|
113
|
-
scheduledFn.timeoutKey,
|
114
|
-
scheduledFn.runAtMillis + scheduledFn.millis);
|
115
|
-
}
|
116
|
-
|
117
|
-
function runScheduledFunctions(endTime) {
|
118
|
-
if (scheduledLookup.length === 0 || scheduledLookup[0] > endTime) {
|
119
|
-
return;
|
120
|
-
}
|
121
|
-
|
122
|
-
do {
|
123
|
-
currentTime = scheduledLookup.shift();
|
124
|
-
|
125
|
-
var funcsToRun = scheduledFunctions[currentTime];
|
126
|
-
delete scheduledFunctions[currentTime];
|
127
|
-
|
128
|
-
for (var i = 0; i < funcsToRun.length; ++i) {
|
129
|
-
var funcToRun = funcsToRun[i];
|
130
|
-
funcToRun.funcToCall.apply(null, funcToRun.params || []);
|
131
|
-
|
132
|
-
if (funcToRun.recurring) {
|
133
|
-
reschedule(funcToRun);
|
134
|
-
}
|
135
|
-
}
|
136
|
-
} while (scheduledLookup.length > 0 &&
|
137
|
-
// checking first if we're out of time prevents setTimeout(0)
|
138
|
-
// scheduled in a funcToRun from forcing an extra iteration
|
139
|
-
currentTime !== endTime &&
|
140
|
-
scheduledLookup[0] <= endTime);
|
141
|
-
}
|
142
|
-
}
|
143
|
-
|
144
|
-
return DelayedFunctionScheduler;
|
145
|
-
};
|
@@ -1,341 +0,0 @@
|
|
1
|
-
getJasmineRequireObj().Env = function(j$) {
|
2
|
-
function Env(options) {
|
3
|
-
options = options || {};
|
4
|
-
|
5
|
-
var self = this;
|
6
|
-
var global = options.global || j$.getGlobal();
|
7
|
-
|
8
|
-
var totalSpecsDefined = 0;
|
9
|
-
|
10
|
-
var catchExceptions = true;
|
11
|
-
|
12
|
-
var realSetTimeout = j$.getGlobal().setTimeout;
|
13
|
-
var realClearTimeout = j$.getGlobal().clearTimeout;
|
14
|
-
this.clock = new j$.Clock(global, new j$.DelayedFunctionScheduler(), new j$.MockDate(global));
|
15
|
-
|
16
|
-
var runnableLookupTable = {};
|
17
|
-
|
18
|
-
var spies = [];
|
19
|
-
|
20
|
-
var currentSpec = null;
|
21
|
-
var currentSuite = null;
|
22
|
-
|
23
|
-
var reporter = new j$.ReportDispatcher([
|
24
|
-
'jasmineStarted',
|
25
|
-
'jasmineDone',
|
26
|
-
'suiteStarted',
|
27
|
-
'suiteDone',
|
28
|
-
'specStarted',
|
29
|
-
'specDone'
|
30
|
-
]);
|
31
|
-
|
32
|
-
this.specFilter = function() {
|
33
|
-
return true;
|
34
|
-
};
|
35
|
-
|
36
|
-
var equalityTesters = [];
|
37
|
-
|
38
|
-
var customEqualityTesters = [];
|
39
|
-
this.addCustomEqualityTester = function(tester) {
|
40
|
-
customEqualityTesters.push(tester);
|
41
|
-
};
|
42
|
-
|
43
|
-
j$.Expectation.addCoreMatchers(j$.matchers);
|
44
|
-
|
45
|
-
var nextSpecId = 0;
|
46
|
-
var getNextSpecId = function() {
|
47
|
-
return 'spec' + nextSpecId++;
|
48
|
-
};
|
49
|
-
|
50
|
-
var nextSuiteId = 0;
|
51
|
-
var getNextSuiteId = function() {
|
52
|
-
return 'suite' + nextSuiteId++;
|
53
|
-
};
|
54
|
-
|
55
|
-
var expectationFactory = function(actual, spec) {
|
56
|
-
return j$.Expectation.Factory({
|
57
|
-
util: j$.matchersUtil,
|
58
|
-
customEqualityTesters: customEqualityTesters,
|
59
|
-
actual: actual,
|
60
|
-
addExpectationResult: addExpectationResult
|
61
|
-
});
|
62
|
-
|
63
|
-
function addExpectationResult(passed, result) {
|
64
|
-
return spec.addExpectationResult(passed, result);
|
65
|
-
}
|
66
|
-
};
|
67
|
-
|
68
|
-
var specStarted = function(spec) {
|
69
|
-
currentSpec = spec;
|
70
|
-
reporter.specStarted(spec.result);
|
71
|
-
};
|
72
|
-
|
73
|
-
var beforeFns = function(suite) {
|
74
|
-
return function() {
|
75
|
-
var befores = [];
|
76
|
-
while(suite) {
|
77
|
-
befores = befores.concat(suite.beforeFns);
|
78
|
-
suite = suite.parentSuite;
|
79
|
-
}
|
80
|
-
return befores.reverse();
|
81
|
-
};
|
82
|
-
};
|
83
|
-
|
84
|
-
var afterFns = function(suite) {
|
85
|
-
return function() {
|
86
|
-
var afters = [];
|
87
|
-
while(suite) {
|
88
|
-
afters = afters.concat(suite.afterFns);
|
89
|
-
suite = suite.parentSuite;
|
90
|
-
}
|
91
|
-
return afters;
|
92
|
-
};
|
93
|
-
};
|
94
|
-
|
95
|
-
var getSpecName = function(spec, suite) {
|
96
|
-
return suite.getFullName() + ' ' + spec.description;
|
97
|
-
};
|
98
|
-
|
99
|
-
// TODO: we may just be able to pass in the fn instead of wrapping here
|
100
|
-
var buildExpectationResult = j$.buildExpectationResult,
|
101
|
-
exceptionFormatter = new j$.ExceptionFormatter(),
|
102
|
-
expectationResultFactory = function(attrs) {
|
103
|
-
attrs.messageFormatter = exceptionFormatter.message;
|
104
|
-
attrs.stackFormatter = exceptionFormatter.stack;
|
105
|
-
|
106
|
-
return buildExpectationResult(attrs);
|
107
|
-
};
|
108
|
-
|
109
|
-
// TODO: fix this naming, and here's where the value comes in
|
110
|
-
this.catchExceptions = function(value) {
|
111
|
-
catchExceptions = !!value;
|
112
|
-
return catchExceptions;
|
113
|
-
};
|
114
|
-
|
115
|
-
this.catchingExceptions = function() {
|
116
|
-
return catchExceptions;
|
117
|
-
};
|
118
|
-
|
119
|
-
var maximumSpecCallbackDepth = 20;
|
120
|
-
var currentSpecCallbackDepth = 0;
|
121
|
-
|
122
|
-
function clearStack(fn) {
|
123
|
-
currentSpecCallbackDepth++;
|
124
|
-
if (currentSpecCallbackDepth >= maximumSpecCallbackDepth) {
|
125
|
-
currentSpecCallbackDepth = 0;
|
126
|
-
realSetTimeout(fn, 0);
|
127
|
-
} else {
|
128
|
-
fn();
|
129
|
-
}
|
130
|
-
}
|
131
|
-
|
132
|
-
var catchException = function(e) {
|
133
|
-
return j$.Spec.isPendingSpecException(e) || catchExceptions;
|
134
|
-
};
|
135
|
-
|
136
|
-
var queueRunnerFactory = function(options) {
|
137
|
-
options.catchException = catchException;
|
138
|
-
options.clearStack = options.clearStack || clearStack;
|
139
|
-
options.timer = {setTimeout: realSetTimeout, clearTimeout: realClearTimeout};
|
140
|
-
|
141
|
-
new j$.QueueRunner(options).execute();
|
142
|
-
};
|
143
|
-
|
144
|
-
var topSuite = new j$.Suite({
|
145
|
-
env: this,
|
146
|
-
id: getNextSuiteId(),
|
147
|
-
description: 'Jasmine__TopLevel__Suite',
|
148
|
-
queueRunner: queueRunnerFactory,
|
149
|
-
resultCallback: function() {} // TODO - hook this up
|
150
|
-
});
|
151
|
-
runnableLookupTable[topSuite.id] = topSuite;
|
152
|
-
currentSuite = topSuite;
|
153
|
-
|
154
|
-
this.topSuite = function() {
|
155
|
-
return topSuite;
|
156
|
-
};
|
157
|
-
|
158
|
-
this.execute = function(runnablesToRun) {
|
159
|
-
runnablesToRun = runnablesToRun || [topSuite.id];
|
160
|
-
|
161
|
-
var allFns = [];
|
162
|
-
for(var i = 0; i < runnablesToRun.length; i++) {
|
163
|
-
var runnable = runnableLookupTable[runnablesToRun[i]];
|
164
|
-
allFns.push((function(runnable) { return function(done) { runnable.execute(done); }; })(runnable));
|
165
|
-
}
|
166
|
-
|
167
|
-
reporter.jasmineStarted({
|
168
|
-
totalSpecsDefined: totalSpecsDefined
|
169
|
-
});
|
170
|
-
|
171
|
-
queueRunnerFactory({fns: allFns, onComplete: reporter.jasmineDone});
|
172
|
-
};
|
173
|
-
|
174
|
-
this.addReporter = function(reporterToAdd) {
|
175
|
-
reporter.addReporter(reporterToAdd);
|
176
|
-
};
|
177
|
-
|
178
|
-
this.addMatchers = function(matchersToAdd) {
|
179
|
-
j$.Expectation.addMatchers(matchersToAdd);
|
180
|
-
};
|
181
|
-
|
182
|
-
this.spyOn = function(obj, methodName) {
|
183
|
-
if (j$.util.isUndefined(obj)) {
|
184
|
-
throw new Error('spyOn could not find an object to spy upon for ' + methodName + '()');
|
185
|
-
}
|
186
|
-
|
187
|
-
if (j$.util.isUndefined(obj[methodName])) {
|
188
|
-
throw new Error(methodName + '() method does not exist');
|
189
|
-
}
|
190
|
-
|
191
|
-
if (obj[methodName] && j$.isSpy(obj[methodName])) {
|
192
|
-
//TODO?: should this return the current spy? Downside: may cause user confusion about spy state
|
193
|
-
throw new Error(methodName + ' has already been spied upon');
|
194
|
-
}
|
195
|
-
|
196
|
-
var spy = j$.createSpy(methodName, obj[methodName]);
|
197
|
-
|
198
|
-
spies.push({
|
199
|
-
spy: spy,
|
200
|
-
baseObj: obj,
|
201
|
-
methodName: methodName,
|
202
|
-
originalValue: obj[methodName]
|
203
|
-
});
|
204
|
-
|
205
|
-
obj[methodName] = spy;
|
206
|
-
|
207
|
-
return spy;
|
208
|
-
};
|
209
|
-
|
210
|
-
var suiteFactory = function(description) {
|
211
|
-
var suite = new j$.Suite({
|
212
|
-
env: self,
|
213
|
-
id: getNextSuiteId(),
|
214
|
-
description: description,
|
215
|
-
parentSuite: currentSuite,
|
216
|
-
queueRunner: queueRunnerFactory,
|
217
|
-
onStart: suiteStarted,
|
218
|
-
resultCallback: function(attrs) {
|
219
|
-
reporter.suiteDone(attrs);
|
220
|
-
}
|
221
|
-
});
|
222
|
-
|
223
|
-
runnableLookupTable[suite.id] = suite;
|
224
|
-
return suite;
|
225
|
-
};
|
226
|
-
|
227
|
-
this.describe = function(description, specDefinitions) {
|
228
|
-
var suite = suiteFactory(description);
|
229
|
-
|
230
|
-
var parentSuite = currentSuite;
|
231
|
-
parentSuite.addChild(suite);
|
232
|
-
currentSuite = suite;
|
233
|
-
|
234
|
-
var declarationError = null;
|
235
|
-
try {
|
236
|
-
specDefinitions.call(suite);
|
237
|
-
} catch (e) {
|
238
|
-
declarationError = e;
|
239
|
-
}
|
240
|
-
|
241
|
-
if (declarationError) {
|
242
|
-
this.it('encountered a declaration exception', function() {
|
243
|
-
throw declarationError;
|
244
|
-
});
|
245
|
-
}
|
246
|
-
|
247
|
-
currentSuite = parentSuite;
|
248
|
-
|
249
|
-
return suite;
|
250
|
-
};
|
251
|
-
|
252
|
-
this.xdescribe = function(description, specDefinitions) {
|
253
|
-
var suite = this.describe(description, specDefinitions);
|
254
|
-
suite.disable();
|
255
|
-
return suite;
|
256
|
-
};
|
257
|
-
|
258
|
-
var specFactory = function(description, fn, suite) {
|
259
|
-
totalSpecsDefined++;
|
260
|
-
|
261
|
-
var spec = new j$.Spec({
|
262
|
-
id: getNextSpecId(),
|
263
|
-
beforeFns: beforeFns(suite),
|
264
|
-
afterFns: afterFns(suite),
|
265
|
-
expectationFactory: expectationFactory,
|
266
|
-
exceptionFormatter: exceptionFormatter,
|
267
|
-
resultCallback: specResultCallback,
|
268
|
-
getSpecName: function(spec) {
|
269
|
-
return getSpecName(spec, suite);
|
270
|
-
},
|
271
|
-
onStart: specStarted,
|
272
|
-
description: description,
|
273
|
-
expectationResultFactory: expectationResultFactory,
|
274
|
-
queueRunnerFactory: queueRunnerFactory,
|
275
|
-
fn: fn
|
276
|
-
});
|
277
|
-
|
278
|
-
runnableLookupTable[spec.id] = spec;
|
279
|
-
|
280
|
-
if (!self.specFilter(spec)) {
|
281
|
-
spec.disable();
|
282
|
-
}
|
283
|
-
|
284
|
-
return spec;
|
285
|
-
|
286
|
-
function removeAllSpies() {
|
287
|
-
for (var i = 0; i < spies.length; i++) {
|
288
|
-
var spyEntry = spies[i];
|
289
|
-
spyEntry.baseObj[spyEntry.methodName] = spyEntry.originalValue;
|
290
|
-
}
|
291
|
-
spies = [];
|
292
|
-
}
|
293
|
-
|
294
|
-
function specResultCallback(result) {
|
295
|
-
removeAllSpies();
|
296
|
-
j$.Expectation.resetMatchers();
|
297
|
-
customEqualityTesters = [];
|
298
|
-
currentSpec = null;
|
299
|
-
reporter.specDone(result);
|
300
|
-
}
|
301
|
-
};
|
302
|
-
|
303
|
-
var suiteStarted = function(suite) {
|
304
|
-
reporter.suiteStarted(suite.result);
|
305
|
-
};
|
306
|
-
|
307
|
-
this.it = function(description, fn) {
|
308
|
-
var spec = specFactory(description, fn, currentSuite);
|
309
|
-
currentSuite.addChild(spec);
|
310
|
-
return spec;
|
311
|
-
};
|
312
|
-
|
313
|
-
this.xit = function(description, fn) {
|
314
|
-
var spec = this.it(description, fn);
|
315
|
-
spec.pend();
|
316
|
-
return spec;
|
317
|
-
};
|
318
|
-
|
319
|
-
this.expect = function(actual) {
|
320
|
-
if (!currentSpec) {
|
321
|
-
throw new Error('\'expect\' was used when there was no current spec, this could be because an asynchronous test timed out');
|
322
|
-
}
|
323
|
-
|
324
|
-
return currentSpec.expect(actual);
|
325
|
-
};
|
326
|
-
|
327
|
-
this.beforeEach = function(beforeEachFunction) {
|
328
|
-
currentSuite.beforeEach(beforeEachFunction);
|
329
|
-
};
|
330
|
-
|
331
|
-
this.afterEach = function(afterEachFunction) {
|
332
|
-
currentSuite.afterEach(afterEachFunction);
|
333
|
-
};
|
334
|
-
|
335
|
-
this.pending = function() {
|
336
|
-
throw j$.Spec.pendingSpecExceptionMessage;
|
337
|
-
};
|
338
|
-
}
|
339
|
-
|
340
|
-
return Env;
|
341
|
-
};
|
@@ -1,29 +0,0 @@
|
|
1
|
-
getJasmineRequireObj().ExceptionFormatter = function() {
|
2
|
-
function ExceptionFormatter() {
|
3
|
-
this.message = function(error) {
|
4
|
-
var message = '';
|
5
|
-
|
6
|
-
if (error.name && error.message) {
|
7
|
-
message += error.name + ': ' + error.message;
|
8
|
-
} else {
|
9
|
-
message += error.toString() + ' thrown';
|
10
|
-
}
|
11
|
-
|
12
|
-
if (error.fileName || error.sourceURL) {
|
13
|
-
message += ' in ' + (error.fileName || error.sourceURL);
|
14
|
-
}
|
15
|
-
|
16
|
-
if (error.line || error.lineNumber) {
|
17
|
-
message += ' (line ' + (error.line || error.lineNumber) + ')';
|
18
|
-
}
|
19
|
-
|
20
|
-
return message;
|
21
|
-
};
|
22
|
-
|
23
|
-
this.stack = function(error) {
|
24
|
-
return error ? error.stack : null;
|
25
|
-
};
|
26
|
-
}
|
27
|
-
|
28
|
-
return ExceptionFormatter;
|
29
|
-
};
|
@@ -1,107 +0,0 @@
|
|
1
|
-
getJasmineRequireObj().Expectation = function() {
|
2
|
-
|
3
|
-
var matchers = {};
|
4
|
-
|
5
|
-
function Expectation(options) {
|
6
|
-
this.util = options.util || { buildFailureMessage: function() {} };
|
7
|
-
this.customEqualityTesters = options.customEqualityTesters || [];
|
8
|
-
this.actual = options.actual;
|
9
|
-
this.addExpectationResult = options.addExpectationResult || function(){};
|
10
|
-
this.isNot = options.isNot;
|
11
|
-
|
12
|
-
for (var matcherName in matchers) {
|
13
|
-
this[matcherName] = matchers[matcherName];
|
14
|
-
}
|
15
|
-
}
|
16
|
-
|
17
|
-
Expectation.prototype.wrapCompare = function(name, matcherFactory) {
|
18
|
-
return function() {
|
19
|
-
var args = Array.prototype.slice.call(arguments, 0),
|
20
|
-
expected = args.slice(0),
|
21
|
-
message = '';
|
22
|
-
|
23
|
-
args.unshift(this.actual);
|
24
|
-
|
25
|
-
var matcher = matcherFactory(this.util, this.customEqualityTesters),
|
26
|
-
matcherCompare = matcher.compare;
|
27
|
-
|
28
|
-
function defaultNegativeCompare() {
|
29
|
-
var result = matcher.compare.apply(null, args);
|
30
|
-
result.pass = !result.pass;
|
31
|
-
return result;
|
32
|
-
}
|
33
|
-
|
34
|
-
if (this.isNot) {
|
35
|
-
matcherCompare = matcher.negativeCompare || defaultNegativeCompare;
|
36
|
-
}
|
37
|
-
|
38
|
-
var result = matcherCompare.apply(null, args);
|
39
|
-
|
40
|
-
if (!result.pass) {
|
41
|
-
if (!result.message) {
|
42
|
-
args.unshift(this.isNot);
|
43
|
-
args.unshift(name);
|
44
|
-
message = this.util.buildFailureMessage.apply(null, args);
|
45
|
-
} else {
|
46
|
-
if (Object.prototype.toString.apply(result.message) === '[object Function]') {
|
47
|
-
message = result.message();
|
48
|
-
} else {
|
49
|
-
message = result.message;
|
50
|
-
}
|
51
|
-
}
|
52
|
-
}
|
53
|
-
|
54
|
-
if (expected.length == 1) {
|
55
|
-
expected = expected[0];
|
56
|
-
}
|
57
|
-
|
58
|
-
// TODO: how many of these params are needed?
|
59
|
-
this.addExpectationResult(
|
60
|
-
result.pass,
|
61
|
-
{
|
62
|
-
matcherName: name,
|
63
|
-
passed: result.pass,
|
64
|
-
message: message,
|
65
|
-
actual: this.actual,
|
66
|
-
expected: expected // TODO: this may need to be arrayified/sliced
|
67
|
-
}
|
68
|
-
);
|
69
|
-
};
|
70
|
-
};
|
71
|
-
|
72
|
-
Expectation.addCoreMatchers = function(matchers) {
|
73
|
-
var prototype = Expectation.prototype;
|
74
|
-
for (var matcherName in matchers) {
|
75
|
-
var matcher = matchers[matcherName];
|
76
|
-
prototype[matcherName] = prototype.wrapCompare(matcherName, matcher);
|
77
|
-
}
|
78
|
-
};
|
79
|
-
|
80
|
-
Expectation.addMatchers = function(matchersToAdd) {
|
81
|
-
for (var name in matchersToAdd) {
|
82
|
-
var matcher = matchersToAdd[name];
|
83
|
-
matchers[name] = Expectation.prototype.wrapCompare(name, matcher);
|
84
|
-
}
|
85
|
-
};
|
86
|
-
|
87
|
-
Expectation.resetMatchers = function() {
|
88
|
-
for (var name in matchers) {
|
89
|
-
delete matchers[name];
|
90
|
-
}
|
91
|
-
};
|
92
|
-
|
93
|
-
Expectation.Factory = function(options) {
|
94
|
-
options = options || {};
|
95
|
-
|
96
|
-
var expect = new Expectation(options);
|
97
|
-
|
98
|
-
// TODO: this would be nice as its own Object - NegativeExpectation
|
99
|
-
// TODO: copy instead of mutate options
|
100
|
-
options.isNot = true;
|
101
|
-
expect.not = new Expectation(options);
|
102
|
-
|
103
|
-
return expect;
|
104
|
-
};
|
105
|
-
|
106
|
-
return Expectation;
|
107
|
-
};
|
@@ -1,45 +0,0 @@
|
|
1
|
-
//TODO: expectation result may make more sense as a presentation of an expectation.
|
2
|
-
getJasmineRequireObj().buildExpectationResult = function() {
|
3
|
-
function buildExpectationResult(options) {
|
4
|
-
var messageFormatter = options.messageFormatter || function() {},
|
5
|
-
stackFormatter = options.stackFormatter || function() {};
|
6
|
-
|
7
|
-
return {
|
8
|
-
matcherName: options.matcherName,
|
9
|
-
expected: options.expected,
|
10
|
-
actual: options.actual,
|
11
|
-
message: message(),
|
12
|
-
stack: stack(),
|
13
|
-
passed: options.passed
|
14
|
-
};
|
15
|
-
|
16
|
-
function message() {
|
17
|
-
if (options.passed) {
|
18
|
-
return 'Passed.';
|
19
|
-
} else if (options.message) {
|
20
|
-
return options.message;
|
21
|
-
} else if (options.error) {
|
22
|
-
return messageFormatter(options.error);
|
23
|
-
}
|
24
|
-
return '';
|
25
|
-
}
|
26
|
-
|
27
|
-
function stack() {
|
28
|
-
if (options.passed) {
|
29
|
-
return '';
|
30
|
-
}
|
31
|
-
|
32
|
-
var error = options.error;
|
33
|
-
if (!error) {
|
34
|
-
try {
|
35
|
-
throw new Error(message());
|
36
|
-
} catch (e) {
|
37
|
-
error = e;
|
38
|
-
}
|
39
|
-
}
|
40
|
-
return stackFormatter(error);
|
41
|
-
}
|
42
|
-
}
|
43
|
-
|
44
|
-
return buildExpectationResult;
|
45
|
-
};
|