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,85 +0,0 @@
|
|
1
|
-
// TODO: Fix these unit tests!
|
2
|
-
describe("Env", function() {
|
3
|
-
var env;
|
4
|
-
beforeEach(function() {
|
5
|
-
env = new j$.Env();
|
6
|
-
});
|
7
|
-
|
8
|
-
it('removes all spies when env is executed', function(done) {
|
9
|
-
var originalFoo = function() {},
|
10
|
-
testObj = {
|
11
|
-
foo: originalFoo
|
12
|
-
},
|
13
|
-
firstSpec = jasmine.createSpy('firstSpec').and.callFake(function() {
|
14
|
-
env.spyOn(testObj, 'foo');
|
15
|
-
}),
|
16
|
-
secondSpec = jasmine.createSpy('secondSpec').and.callFake(function() {
|
17
|
-
expect(testObj.foo).toBe(originalFoo);
|
18
|
-
});
|
19
|
-
env.describe('test suite', function() {
|
20
|
-
env.it('spec 0', firstSpec);
|
21
|
-
env.it('spec 1', secondSpec);
|
22
|
-
});
|
23
|
-
|
24
|
-
var assertions = function() {
|
25
|
-
expect(firstSpec).toHaveBeenCalled();
|
26
|
-
expect(secondSpec).toHaveBeenCalled();
|
27
|
-
done();
|
28
|
-
};
|
29
|
-
|
30
|
-
env.addReporter({ jasmineDone: assertions });
|
31
|
-
|
32
|
-
env.execute();
|
33
|
-
});
|
34
|
-
|
35
|
-
describe("#spyOn", function() {
|
36
|
-
it("checks for the existence of the object", function() {
|
37
|
-
expect(function() {
|
38
|
-
env.spyOn(void 0, 'pants');
|
39
|
-
}).toThrowError(/could not find an object/);
|
40
|
-
});
|
41
|
-
|
42
|
-
it("checks for the existence of the method", function() {
|
43
|
-
var subject = {};
|
44
|
-
|
45
|
-
expect(function() {
|
46
|
-
env.spyOn(subject, 'pants');
|
47
|
-
}).toThrowError(/method does not exist/);
|
48
|
-
});
|
49
|
-
|
50
|
-
it("checks if it has already been spied upon", function() {
|
51
|
-
var subject = { spiedFunc: function() {} };
|
52
|
-
|
53
|
-
env.spyOn(subject, 'spiedFunc');
|
54
|
-
|
55
|
-
expect(function() {
|
56
|
-
env.spyOn(subject, 'spiedFunc');
|
57
|
-
}).toThrowError(/has already been spied upon/);
|
58
|
-
});
|
59
|
-
|
60
|
-
it("overrides the method on the object and returns the spy", function() {
|
61
|
-
var originalFunctionWasCalled = false;
|
62
|
-
var subject = { spiedFunc: function() { originalFunctionWasCalled = true; } };
|
63
|
-
|
64
|
-
var spy = env.spyOn(subject, 'spiedFunc');
|
65
|
-
|
66
|
-
expect(subject.spiedFunc).toEqual(spy);
|
67
|
-
});
|
68
|
-
});
|
69
|
-
|
70
|
-
describe("#pending", function() {
|
71
|
-
it("throws the Pending Spec exception", function() {
|
72
|
-
expect(function() {
|
73
|
-
env.pending();
|
74
|
-
}).toThrow(j$.Spec.pendingSpecExceptionMessage);
|
75
|
-
});
|
76
|
-
});
|
77
|
-
|
78
|
-
describe("#topSuite", function() {
|
79
|
-
it("returns the Jasmine top suite for users to traverse the spec tree", function() {
|
80
|
-
var suite = env.topSuite();
|
81
|
-
expect(suite.description).toEqual('Jasmine__TopLevel__Suite');
|
82
|
-
});
|
83
|
-
});
|
84
|
-
});
|
85
|
-
|
@@ -1,63 +0,0 @@
|
|
1
|
-
describe("ExceptionFormatter", function() {
|
2
|
-
describe("#message", function() {
|
3
|
-
it('formats Firefox exception messages', function() {
|
4
|
-
var sampleFirefoxException = {
|
5
|
-
fileName: 'foo.js',
|
6
|
-
lineNumber: '1978',
|
7
|
-
message: 'you got your foo in my bar',
|
8
|
-
name: 'A Classic Mistake'
|
9
|
-
},
|
10
|
-
exceptionFormatter = new j$.ExceptionFormatter(),
|
11
|
-
message = exceptionFormatter.message(sampleFirefoxException);
|
12
|
-
|
13
|
-
expect(message).toEqual('A Classic Mistake: you got your foo in my bar in foo.js (line 1978)');
|
14
|
-
});
|
15
|
-
|
16
|
-
it('formats Webkit exception messages', function() {
|
17
|
-
var sampleWebkitException = {
|
18
|
-
sourceURL: 'foo.js',
|
19
|
-
line: '1978',
|
20
|
-
message: 'you got your foo in my bar',
|
21
|
-
name: 'A Classic Mistake'
|
22
|
-
},
|
23
|
-
exceptionFormatter = new j$.ExceptionFormatter(),
|
24
|
-
message = exceptionFormatter.message(sampleWebkitException);
|
25
|
-
|
26
|
-
expect(message).toEqual('A Classic Mistake: you got your foo in my bar in foo.js (line 1978)');
|
27
|
-
});
|
28
|
-
|
29
|
-
it('formats V8 exception messages', function() {
|
30
|
-
var sampleV8 = {
|
31
|
-
message: 'you got your foo in my bar',
|
32
|
-
name: 'A Classic Mistake'
|
33
|
-
},
|
34
|
-
exceptionFormatter = new j$.ExceptionFormatter(),
|
35
|
-
message = exceptionFormatter.message(sampleV8);
|
36
|
-
|
37
|
-
expect(message).toEqual('A Classic Mistake: you got your foo in my bar');
|
38
|
-
});
|
39
|
-
|
40
|
-
it("formats thrown exceptions that aren't errors", function() {
|
41
|
-
var thrown = "crazy error",
|
42
|
-
exceptionFormatter = new j$.ExceptionFormatter(),
|
43
|
-
message = exceptionFormatter.message(thrown);
|
44
|
-
|
45
|
-
expect(message).toEqual("crazy error thrown");
|
46
|
-
});
|
47
|
-
});
|
48
|
-
|
49
|
-
describe("#stack", function() {
|
50
|
-
it("formats stack traces from Webkit, Firefox, node.js or IE10+", function() {
|
51
|
-
if (jasmine.getEnv().ieVersion < 10 || jasmine.getEnv().safariVersion < 6) { return; }
|
52
|
-
|
53
|
-
var error;
|
54
|
-
try { throw new Error("an error") } catch(e) { error = e; }
|
55
|
-
|
56
|
-
expect(new j$.ExceptionFormatter().stack(error)).toMatch(/ExceptionFormatterSpec\.js.*\d+/)
|
57
|
-
});
|
58
|
-
|
59
|
-
it("returns null if no Error provided", function() {
|
60
|
-
expect(new j$.ExceptionFormatter().stack()).toBeNull();
|
61
|
-
});
|
62
|
-
});
|
63
|
-
});
|
@@ -1,68 +0,0 @@
|
|
1
|
-
describe('Exceptions:', function() {
|
2
|
-
var env;
|
3
|
-
|
4
|
-
beforeEach(function() {
|
5
|
-
env = new j$.Env();
|
6
|
-
});
|
7
|
-
|
8
|
-
describe('with break on exception', function() {
|
9
|
-
it('should not catch the exception', function() {
|
10
|
-
env.catchExceptions(false);
|
11
|
-
env.describe('suite for break on exceptions', function() {
|
12
|
-
env.it('should break when an exception is thrown', function() {
|
13
|
-
throw new Error('I should hit a breakpoint!');
|
14
|
-
});
|
15
|
-
});
|
16
|
-
var spy = jasmine.createSpy('spy');
|
17
|
-
|
18
|
-
try {
|
19
|
-
env.execute();
|
20
|
-
spy();
|
21
|
-
}
|
22
|
-
catch (e) {}
|
23
|
-
|
24
|
-
expect(spy).not.toHaveBeenCalled();
|
25
|
-
});
|
26
|
-
});
|
27
|
-
|
28
|
-
describe("with catch on exception", function() {
|
29
|
-
it('should handle exceptions thrown, but continue', function(done) {
|
30
|
-
var secondTest = jasmine.createSpy('second test');
|
31
|
-
env.describe('Suite for handles exceptions', function () {
|
32
|
-
env.it('should be a test that fails because it throws an exception', function() {
|
33
|
-
throw new Error();
|
34
|
-
});
|
35
|
-
env.it('should be a passing test that runs after exceptions are thrown from a async test', secondTest);
|
36
|
-
});
|
37
|
-
|
38
|
-
var expectations = function() {
|
39
|
-
expect(secondTest).toHaveBeenCalled();
|
40
|
-
done();
|
41
|
-
};
|
42
|
-
|
43
|
-
env.addReporter({ jasmineDone: expectations });
|
44
|
-
env.execute();
|
45
|
-
});
|
46
|
-
|
47
|
-
it("should handle exceptions thrown directly in top-level describe blocks and continue", function(done) {
|
48
|
-
var secondDescribe = jasmine.createSpy("second describe");
|
49
|
-
env.describe("a suite that throws an exception", function () {
|
50
|
-
env.it("is a test that should pass", function () {
|
51
|
-
this.expect(true).toEqual(true);
|
52
|
-
});
|
53
|
-
|
54
|
-
throw new Error("top level error");
|
55
|
-
});
|
56
|
-
env.describe("a suite that doesn't throw an exception", secondDescribe);
|
57
|
-
|
58
|
-
var expectations = function() {
|
59
|
-
expect(secondDescribe).toHaveBeenCalled();
|
60
|
-
done();
|
61
|
-
};
|
62
|
-
|
63
|
-
env.addReporter({ jasmineDone: expectations });
|
64
|
-
env.execute();
|
65
|
-
});
|
66
|
-
});
|
67
|
-
});
|
68
|
-
|
@@ -1,61 +0,0 @@
|
|
1
|
-
describe("buildExpectationResult", function() {
|
2
|
-
it("defaults to passed", function() {
|
3
|
-
var result = j$.buildExpectationResult({passed: 'some-value'});
|
4
|
-
expect(result.passed).toBe('some-value');
|
5
|
-
});
|
6
|
-
|
7
|
-
it("message defaults to Passed for passing specs", function() {
|
8
|
-
var result = j$.buildExpectationResult({passed: true, message: 'some-value'});
|
9
|
-
expect(result.message).toBe('Passed.');
|
10
|
-
});
|
11
|
-
|
12
|
-
it("message returns the message for failing expectations", function() {
|
13
|
-
var result = j$.buildExpectationResult({passed: false, message: 'some-value'});
|
14
|
-
expect(result.message).toBe('some-value');
|
15
|
-
});
|
16
|
-
|
17
|
-
it("delegates message formatting to the provided formatter if there was an Error", function() {
|
18
|
-
var fakeError = {message: 'foo'},
|
19
|
-
messageFormatter = jasmine.createSpy("exception message formatter").and.returnValue(fakeError.message);
|
20
|
-
|
21
|
-
var result = j$.buildExpectationResult(
|
22
|
-
{
|
23
|
-
passed: false,
|
24
|
-
error: fakeError,
|
25
|
-
messageFormatter: messageFormatter
|
26
|
-
});
|
27
|
-
|
28
|
-
expect(messageFormatter).toHaveBeenCalledWith(fakeError);
|
29
|
-
expect(result.message).toEqual('foo');
|
30
|
-
});
|
31
|
-
|
32
|
-
it("delegates stack formatting to the provided formatter if there was an Error", function() {
|
33
|
-
var fakeError = {stack: 'foo'},
|
34
|
-
stackFormatter = jasmine.createSpy("stack formatter").and.returnValue(fakeError.stack);
|
35
|
-
|
36
|
-
var result = j$.buildExpectationResult(
|
37
|
-
{
|
38
|
-
passed: false,
|
39
|
-
error: fakeError,
|
40
|
-
stackFormatter: stackFormatter
|
41
|
-
});
|
42
|
-
|
43
|
-
expect(stackFormatter).toHaveBeenCalledWith(fakeError);
|
44
|
-
expect(result.stack).toEqual('foo');
|
45
|
-
});
|
46
|
-
|
47
|
-
it("matcherName returns passed matcherName", function() {
|
48
|
-
var result = j$.buildExpectationResult({matcherName: 'some-value'});
|
49
|
-
expect(result.matcherName).toBe('some-value');
|
50
|
-
});
|
51
|
-
|
52
|
-
it("expected returns passed expected", function() {
|
53
|
-
var result = j$.buildExpectationResult({expected: 'some-value'});
|
54
|
-
expect(result.expected).toBe('some-value');
|
55
|
-
});
|
56
|
-
|
57
|
-
it("actual returns passed actual", function() {
|
58
|
-
var result = j$.buildExpectationResult({actual: 'some-value'});
|
59
|
-
expect(result.actual).toBe('some-value');
|
60
|
-
});
|
61
|
-
});
|
@@ -1,427 +0,0 @@
|
|
1
|
-
describe("Expectation", function() {
|
2
|
-
it(".addMatchers makes matchers available to any expectation", function() {
|
3
|
-
var matchers = {
|
4
|
-
toFoo: function() {},
|
5
|
-
toBar: function() {}
|
6
|
-
},
|
7
|
-
expectation;
|
8
|
-
|
9
|
-
j$.Expectation.addMatchers(matchers);
|
10
|
-
|
11
|
-
expectation = new j$.Expectation({});
|
12
|
-
|
13
|
-
expect(expectation.toFoo).toBeDefined();
|
14
|
-
expect(expectation.toBar).toBeDefined();
|
15
|
-
});
|
16
|
-
|
17
|
-
it(".addCoreMatchers makes matchers available to any expectation", function() {
|
18
|
-
var coreMatchers = {
|
19
|
-
toQuux: function() {}
|
20
|
-
},
|
21
|
-
expectation;
|
22
|
-
|
23
|
-
j$.Expectation.addCoreMatchers(coreMatchers);
|
24
|
-
|
25
|
-
expectation = new j$.Expectation({});
|
26
|
-
|
27
|
-
expect(expectation.toQuux).toBeDefined();
|
28
|
-
});
|
29
|
-
|
30
|
-
it(".resetMatchers should keep only core matchers", function() {
|
31
|
-
var matchers = {
|
32
|
-
toFoo: function() {}
|
33
|
-
},
|
34
|
-
coreMatchers = {
|
35
|
-
toQuux: function() {}
|
36
|
-
},
|
37
|
-
expectation;
|
38
|
-
|
39
|
-
j$.Expectation.addCoreMatchers(coreMatchers);
|
40
|
-
j$.Expectation.addMatchers(matchers);
|
41
|
-
j$.Expectation.resetMatchers();
|
42
|
-
|
43
|
-
expectation = new j$.Expectation({});
|
44
|
-
|
45
|
-
expect(expectation.toQuux).toBeDefined();
|
46
|
-
expect(expectation.toFoo).toBeUndefined();
|
47
|
-
});
|
48
|
-
|
49
|
-
it("Factory builds an expectation/negative expectation", function() {
|
50
|
-
var builtExpectation = j$.Expectation.Factory();
|
51
|
-
|
52
|
-
expect(builtExpectation instanceof j$.Expectation).toBe(true);
|
53
|
-
expect(builtExpectation.not instanceof j$.Expectation).toBe(true);
|
54
|
-
expect(builtExpectation.not.isNot).toBe(true);
|
55
|
-
});
|
56
|
-
|
57
|
-
it("wraps matchers's compare functions, passing in matcher dependencies", function() {
|
58
|
-
var fakeCompare = function() { return { pass: true }; },
|
59
|
-
matcherFactory = jasmine.createSpy("matcher").and.returnValue({ compare: fakeCompare }),
|
60
|
-
matchers = {
|
61
|
-
toFoo: matcherFactory
|
62
|
-
},
|
63
|
-
util = {},
|
64
|
-
customEqualityTesters = ['a'],
|
65
|
-
addExpectationResult = jasmine.createSpy("addExpectationResult"),
|
66
|
-
expectation;
|
67
|
-
|
68
|
-
j$.Expectation.addMatchers(matchers);
|
69
|
-
|
70
|
-
expectation = new j$.Expectation({
|
71
|
-
util: util,
|
72
|
-
customEqualityTesters: customEqualityTesters,
|
73
|
-
actual: "an actual",
|
74
|
-
addExpectationResult: addExpectationResult
|
75
|
-
});
|
76
|
-
|
77
|
-
expectation.toFoo("hello");
|
78
|
-
|
79
|
-
expect(matcherFactory).toHaveBeenCalledWith(util, customEqualityTesters)
|
80
|
-
});
|
81
|
-
|
82
|
-
it("wraps matchers's compare functions, passing the actual and expected", function() {
|
83
|
-
var fakeCompare = jasmine.createSpy('fake-compare').and.returnValue({pass: true}),
|
84
|
-
matchers = {
|
85
|
-
toFoo: function() {
|
86
|
-
return {
|
87
|
-
compare: fakeCompare
|
88
|
-
};
|
89
|
-
}
|
90
|
-
},
|
91
|
-
util = {
|
92
|
-
buildFailureMessage: jasmine.createSpy('buildFailureMessage')
|
93
|
-
},
|
94
|
-
addExpectationResult = jasmine.createSpy("addExpectationResult"),
|
95
|
-
expectation;
|
96
|
-
|
97
|
-
j$.Expectation.addMatchers(matchers);
|
98
|
-
|
99
|
-
expectation = new j$.Expectation({
|
100
|
-
util: util,
|
101
|
-
actual: "an actual",
|
102
|
-
addExpectationResult: addExpectationResult
|
103
|
-
});
|
104
|
-
|
105
|
-
expectation.toFoo("hello");
|
106
|
-
|
107
|
-
expect(fakeCompare).toHaveBeenCalledWith("an actual", "hello");
|
108
|
-
});
|
109
|
-
|
110
|
-
it("reports a passing result to the spec when the comparison passes", function() {
|
111
|
-
var matchers = {
|
112
|
-
toFoo: function() {
|
113
|
-
return {
|
114
|
-
compare: function() { return { pass: true }; }
|
115
|
-
};
|
116
|
-
}
|
117
|
-
},
|
118
|
-
util = {
|
119
|
-
buildFailureMessage: jasmine.createSpy('buildFailureMessage')
|
120
|
-
},
|
121
|
-
addExpectationResult = jasmine.createSpy("addExpectationResult"),
|
122
|
-
expectation;
|
123
|
-
|
124
|
-
j$.Expectation.addMatchers(matchers);
|
125
|
-
|
126
|
-
expectation = new j$.Expectation({
|
127
|
-
matchers: matchers,
|
128
|
-
util: util,
|
129
|
-
actual: "an actual",
|
130
|
-
addExpectationResult: addExpectationResult
|
131
|
-
});
|
132
|
-
|
133
|
-
expectation.toFoo("hello");
|
134
|
-
|
135
|
-
expect(addExpectationResult).toHaveBeenCalledWith(true, {
|
136
|
-
matcherName: "toFoo",
|
137
|
-
passed: true,
|
138
|
-
message: "",
|
139
|
-
expected: "hello",
|
140
|
-
actual: "an actual"
|
141
|
-
});
|
142
|
-
});
|
143
|
-
|
144
|
-
it("reports a failing result to the spec when the comparison fails", function() {
|
145
|
-
var matchers = {
|
146
|
-
toFoo: function() {
|
147
|
-
return {
|
148
|
-
compare: function() { return { pass: false }; }
|
149
|
-
};
|
150
|
-
}
|
151
|
-
},
|
152
|
-
util = {
|
153
|
-
buildFailureMessage: function() { return ""; }
|
154
|
-
},
|
155
|
-
addExpectationResult = jasmine.createSpy("addExpectationResult"),
|
156
|
-
expectation;
|
157
|
-
|
158
|
-
j$.Expectation.addMatchers(matchers);
|
159
|
-
|
160
|
-
expectation = new j$.Expectation({
|
161
|
-
matchers: matchers,
|
162
|
-
util: util,
|
163
|
-
actual: "an actual",
|
164
|
-
addExpectationResult: addExpectationResult
|
165
|
-
});
|
166
|
-
|
167
|
-
expectation.toFoo("hello");
|
168
|
-
|
169
|
-
expect(addExpectationResult).toHaveBeenCalledWith(false, {
|
170
|
-
matcherName: "toFoo",
|
171
|
-
passed: false,
|
172
|
-
expected: "hello",
|
173
|
-
actual: "an actual",
|
174
|
-
message: ""
|
175
|
-
});
|
176
|
-
});
|
177
|
-
|
178
|
-
it("reports a failing result and a custom fail message to the spec when the comparison fails", function() {
|
179
|
-
var matchers = {
|
180
|
-
toFoo: function() {
|
181
|
-
return {
|
182
|
-
compare: function() {
|
183
|
-
return {
|
184
|
-
pass: false,
|
185
|
-
message: "I am a custom message"
|
186
|
-
};
|
187
|
-
}
|
188
|
-
};
|
189
|
-
}
|
190
|
-
},
|
191
|
-
addExpectationResult = jasmine.createSpy("addExpectationResult"),
|
192
|
-
expectation;
|
193
|
-
|
194
|
-
j$.Expectation.addMatchers(matchers);
|
195
|
-
|
196
|
-
expectation = new j$.Expectation({
|
197
|
-
actual: "an actual",
|
198
|
-
addExpectationResult: addExpectationResult
|
199
|
-
});
|
200
|
-
|
201
|
-
expectation.toFoo("hello");
|
202
|
-
|
203
|
-
expect(addExpectationResult).toHaveBeenCalledWith(false, {
|
204
|
-
matcherName: "toFoo",
|
205
|
-
passed: false,
|
206
|
-
expected: "hello",
|
207
|
-
actual: "an actual",
|
208
|
-
message: "I am a custom message"
|
209
|
-
});
|
210
|
-
});
|
211
|
-
|
212
|
-
it("reports a failing result with a custom fail message function to the spec when the comparison fails", function() {
|
213
|
-
var matchers = {
|
214
|
-
toFoo: function() {
|
215
|
-
return {
|
216
|
-
compare: function() {
|
217
|
-
return {
|
218
|
-
pass: false,
|
219
|
-
message: function() { return "I am a custom message"; }
|
220
|
-
};
|
221
|
-
}
|
222
|
-
};
|
223
|
-
}
|
224
|
-
},
|
225
|
-
addExpectationResult = jasmine.createSpy("addExpectationResult"),
|
226
|
-
expectation;
|
227
|
-
|
228
|
-
j$.Expectation.addMatchers(matchers);
|
229
|
-
|
230
|
-
expectation = new j$.Expectation({
|
231
|
-
matchers: matchers,
|
232
|
-
actual: "an actual",
|
233
|
-
addExpectationResult: addExpectationResult
|
234
|
-
});
|
235
|
-
|
236
|
-
expectation.toFoo("hello");
|
237
|
-
|
238
|
-
expect(addExpectationResult).toHaveBeenCalledWith(false, {
|
239
|
-
matcherName: "toFoo",
|
240
|
-
passed: false,
|
241
|
-
expected: "hello",
|
242
|
-
actual: "an actual",
|
243
|
-
message: "I am a custom message"
|
244
|
-
});
|
245
|
-
});
|
246
|
-
|
247
|
-
it("reports a passing result to the spec when the comparison fails for a negative expectation", function() {
|
248
|
-
var matchers = {
|
249
|
-
toFoo: function() {
|
250
|
-
return {
|
251
|
-
compare: function() { return { pass: false }; }
|
252
|
-
};
|
253
|
-
}
|
254
|
-
},
|
255
|
-
util = {
|
256
|
-
buildFailureMessage: function() { return ""; }
|
257
|
-
},
|
258
|
-
addExpectationResult = jasmine.createSpy("addExpectationResult"),
|
259
|
-
actual = "an actual",
|
260
|
-
expectation;
|
261
|
-
|
262
|
-
j$.Expectation.addMatchers(matchers);
|
263
|
-
|
264
|
-
expectation = new j$.Expectation({
|
265
|
-
matchers: matchers,
|
266
|
-
actual: "an actual",
|
267
|
-
addExpectationResult: addExpectationResult,
|
268
|
-
isNot: true
|
269
|
-
});
|
270
|
-
|
271
|
-
expectation.toFoo("hello");
|
272
|
-
|
273
|
-
expect(addExpectationResult).toHaveBeenCalledWith(true, {
|
274
|
-
matcherName: "toFoo",
|
275
|
-
passed: true,
|
276
|
-
message: "",
|
277
|
-
expected: "hello",
|
278
|
-
actual: actual
|
279
|
-
});
|
280
|
-
});
|
281
|
-
|
282
|
-
it("reports a failing result to the spec when the comparison passes for a negative expectation", function() {
|
283
|
-
var matchers = {
|
284
|
-
toFoo: function() {
|
285
|
-
return {
|
286
|
-
compare: function() { return { pass: true }; }
|
287
|
-
};
|
288
|
-
}
|
289
|
-
},
|
290
|
-
util = {
|
291
|
-
buildFailureMessage: function() { return "default message"; }
|
292
|
-
},
|
293
|
-
addExpectationResult = jasmine.createSpy("addExpectationResult"),
|
294
|
-
actual = "an actual",
|
295
|
-
expectation;
|
296
|
-
|
297
|
-
j$.Expectation.addMatchers(matchers);
|
298
|
-
|
299
|
-
expectation = new j$.Expectation({
|
300
|
-
matchers: matchers,
|
301
|
-
actual: "an actual",
|
302
|
-
util: util,
|
303
|
-
addExpectationResult: addExpectationResult,
|
304
|
-
isNot: true
|
305
|
-
});
|
306
|
-
|
307
|
-
expectation.toFoo("hello");
|
308
|
-
|
309
|
-
expect(addExpectationResult).toHaveBeenCalledWith(false, {
|
310
|
-
matcherName: "toFoo",
|
311
|
-
passed: false,
|
312
|
-
expected: "hello",
|
313
|
-
actual: actual,
|
314
|
-
message: "default message"
|
315
|
-
});
|
316
|
-
});
|
317
|
-
|
318
|
-
it("reports a failing result and a custom fail message to the spec when the comparison passes for a negative expectation", function() {
|
319
|
-
var matchers = {
|
320
|
-
toFoo: function() {
|
321
|
-
return {
|
322
|
-
compare: function() {
|
323
|
-
return {
|
324
|
-
pass: true,
|
325
|
-
message: "I am a custom message"
|
326
|
-
};
|
327
|
-
}
|
328
|
-
};
|
329
|
-
}
|
330
|
-
},
|
331
|
-
addExpectationResult = jasmine.createSpy("addExpectationResult"),
|
332
|
-
actual = "an actual",
|
333
|
-
expectation;
|
334
|
-
|
335
|
-
j$.Expectation.addMatchers(matchers);
|
336
|
-
|
337
|
-
expectation = new j$.Expectation({
|
338
|
-
matchers: matchers,
|
339
|
-
actual: "an actual",
|
340
|
-
addExpectationResult: addExpectationResult,
|
341
|
-
isNot: true
|
342
|
-
});
|
343
|
-
|
344
|
-
expectation.toFoo("hello");
|
345
|
-
|
346
|
-
expect(addExpectationResult).toHaveBeenCalledWith(false, {
|
347
|
-
matcherName: "toFoo",
|
348
|
-
passed: false,
|
349
|
-
expected: "hello",
|
350
|
-
actual: actual,
|
351
|
-
message: "I am a custom message"
|
352
|
-
});
|
353
|
-
});
|
354
|
-
|
355
|
-
it("reports a passing result to the spec when the 'not' comparison passes, given a negativeCompare", function() {
|
356
|
-
var matchers = {
|
357
|
-
toFoo: function() {
|
358
|
-
return {
|
359
|
-
compare: function() { return { pass: true }; },
|
360
|
-
negativeCompare: function() { return { pass: true }; }
|
361
|
-
};
|
362
|
-
}
|
363
|
-
},
|
364
|
-
addExpectationResult = jasmine.createSpy("addExpectationResult"),
|
365
|
-
actual = "an actual",
|
366
|
-
expectation;
|
367
|
-
|
368
|
-
j$.Expectation.addMatchers(matchers);
|
369
|
-
|
370
|
-
expectation = new j$.Expectation({
|
371
|
-
matchers: matchers,
|
372
|
-
actual: "an actual",
|
373
|
-
addExpectationResult: addExpectationResult,
|
374
|
-
isNot: true
|
375
|
-
});
|
376
|
-
|
377
|
-
expectation.toFoo("hello");
|
378
|
-
|
379
|
-
expect(addExpectationResult).toHaveBeenCalledWith(true, {
|
380
|
-
matcherName: "toFoo",
|
381
|
-
passed: true,
|
382
|
-
expected: "hello",
|
383
|
-
actual: actual,
|
384
|
-
message: ""
|
385
|
-
});
|
386
|
-
});
|
387
|
-
|
388
|
-
it("reports a failing result and a custom fail message to the spec when the 'not' comparison fails, given a negativeCompare", function() {
|
389
|
-
var matchers = {
|
390
|
-
toFoo: function() {
|
391
|
-
return {
|
392
|
-
compare: function() { return { pass: true }; },
|
393
|
-
negativeCompare: function() {
|
394
|
-
return {
|
395
|
-
pass: false,
|
396
|
-
message: "I'm a custom message"
|
397
|
-
};
|
398
|
-
}
|
399
|
-
};
|
400
|
-
}
|
401
|
-
},
|
402
|
-
addExpectationResult = jasmine.createSpy("addExpectationResult"),
|
403
|
-
actual = "an actual",
|
404
|
-
expectation;
|
405
|
-
|
406
|
-
j$.Expectation.addMatchers(matchers);
|
407
|
-
|
408
|
-
expectation = new j$.Expectation({
|
409
|
-
matchers: matchers,
|
410
|
-
actual: "an actual",
|
411
|
-
addExpectationResult: addExpectationResult,
|
412
|
-
isNot: true
|
413
|
-
});
|
414
|
-
|
415
|
-
expectation.toFoo("hello");
|
416
|
-
|
417
|
-
expect(addExpectationResult).toHaveBeenCalledWith(false, {
|
418
|
-
matcherName: "toFoo",
|
419
|
-
passed: false,
|
420
|
-
expected: "hello",
|
421
|
-
actual: actual,
|
422
|
-
message: "I'm a custom message"
|
423
|
-
});
|
424
|
-
});
|
425
|
-
|
426
|
-
});
|
427
|
-
|