├── lib
├── jasmine
│ ├── .rspec
│ ├── images
│ │ ├── __init__.py
│ │ ├── jasmine_favicon.png
│ │ └── jasmine-horizontal.png
│ ├── requirements.txt
│ ├── lib
│ │ ├── jasmine-core
│ │ │ ├── __init__.py
│ │ │ ├── example
│ │ │ │ ├── src
│ │ │ │ │ ├── Song.js
│ │ │ │ │ └── Player.js
│ │ │ │ ├── node_example
│ │ │ │ │ ├── src
│ │ │ │ │ │ ├── Song.js
│ │ │ │ │ │ └── Player.js
│ │ │ │ │ └── spec
│ │ │ │ │ │ ├── SpecHelper.js
│ │ │ │ │ │ └── PlayerSpec.js
│ │ │ │ └── spec
│ │ │ │ │ ├── SpecHelper.js
│ │ │ │ │ └── PlayerSpec.js
│ │ │ ├── version.rb
│ │ │ ├── boot
│ │ │ │ └── node_boot.js
│ │ │ ├── core.py
│ │ │ └── node_boot.js
│ │ ├── jasmine-core.js
│ │ └── jasmine-core.rb
│ ├── src
│ │ ├── html
│ │ │ ├── jasmine.scss
│ │ │ ├── requireHtml.js
│ │ │ ├── HtmlSpecFilter.js
│ │ │ ├── ResultsNode.js
│ │ │ └── QueryString.js
│ │ ├── version.js
│ │ ├── templates
│ │ │ ├── version.rb.erb
│ │ │ ├── version.js.erb
│ │ │ └── example_project_jasmine_tags.html.erb
│ │ ├── core
│ │ │ ├── matchers
│ │ │ │ ├── toBe.js
│ │ │ │ ├── toBeFalsy.js
│ │ │ │ ├── toBeNull.js
│ │ │ │ ├── toBeTruthy.js
│ │ │ │ ├── toBeDefined.js
│ │ │ │ ├── toBeLessThan.js
│ │ │ │ ├── toBeUndefined.js
│ │ │ │ ├── toBeGreaterThan.js
│ │ │ │ ├── toMatch.js
│ │ │ │ ├── toContain.js
│ │ │ │ ├── toBeCloseTo.js
│ │ │ │ ├── toEqual.js
│ │ │ │ ├── toBeNaN.js
│ │ │ │ ├── requireMatchers.js
│ │ │ │ ├── toHaveBeenCalled.js
│ │ │ │ ├── toThrow.js
│ │ │ │ └── toHaveBeenCalledWith.js
│ │ │ ├── Timer.js
│ │ │ ├── ExceptionFormatter.js
│ │ │ ├── ReportDispatcher.js
│ │ │ ├── Any.js
│ │ │ ├── util.js
│ │ │ ├── CallTracker.js
│ │ │ ├── SpyStrategy.js
│ │ │ ├── ExpectationResult.js
│ │ │ ├── requireCore.js
│ │ │ ├── ObjectContaining.js
│ │ │ ├── requireInterface.js
│ │ │ ├── JsApiReporter.js
│ │ │ ├── Suite.js
│ │ │ ├── MockDate.js
│ │ │ ├── QueueRunner.js
│ │ │ ├── base.js
│ │ │ ├── Expectation.js
│ │ │ ├── Clock.js
│ │ │ └── Spec.js
│ │ └── console
│ │ │ ├── requireConsole.js
│ │ │ └── ConsoleReporter.js
│ ├── .gitmodules
│ ├── travis-node-script.sh
│ ├── dist
│ │ ├── jasmine-standalone-1.0.0.zip
│ │ ├── jasmine-standalone-1.1.0.zip
│ │ ├── jasmine-standalone-1.2.0.zip
│ │ ├── jasmine-standalone-1.3.0.zip
│ │ ├── jasmine-standalone-1.3.1.zip
│ │ ├── jasmine-standalone-2.0.0.zip
│ │ ├── jasmine-standalone-2.0.1.zip
│ │ ├── jasmine-standalone-2.0.2.zip
│ │ └── jasmine-standalone-2.0.3.zip
│ ├── MANIFEST.in
│ ├── .jshintrc
│ ├── travis-docs-script.sh
│ ├── spec
│ │ ├── support
│ │ │ ├── jasmine-performance.yml
│ │ │ ├── jasmine.json
│ │ │ ├── jasmine-performance.json
│ │ │ └── jasmine.yml
│ │ ├── performance
│ │ │ ├── performance_test.js
│ │ │ └── large_object_test.js
│ │ ├── helpers
│ │ │ ├── defineJasmineUnderTest.js
│ │ │ ├── BrowserFlags.js
│ │ │ └── nodeDefineJasmineUnderTest.js
│ │ ├── core
│ │ │ ├── matchers
│ │ │ │ ├── toBeNullSpec.js
│ │ │ │ ├── toBeSpec.js
│ │ │ │ ├── toBeDefinedSpec.js
│ │ │ │ ├── toBeUndefinedSpec.js
│ │ │ │ ├── toBeLessThanSpec.js
│ │ │ │ ├── toBeGreaterThanSpec.js
│ │ │ │ ├── toEqualSpec.js
│ │ │ │ ├── toContainSpec.js
│ │ │ │ ├── toMatchSpec.js
│ │ │ │ ├── toBeFalsySpec.js
│ │ │ │ ├── toBeTruthySpec.js
│ │ │ │ ├── toBeNaNSpec.js
│ │ │ │ ├── toBeCloseToSpec.js
│ │ │ │ ├── toHaveBeenCalledSpec.js
│ │ │ │ ├── toHaveBeenCalledWithSpec.js
│ │ │ │ └── toThrowSpec.js
│ │ │ ├── TimerSpec.js
│ │ │ ├── UtilSpec.js
│ │ │ ├── AnySpec.js
│ │ │ ├── ReportDispatcherSpec.js
│ │ │ ├── ExceptionsSpec.js
│ │ │ ├── ExpectationResultSpec.js
│ │ │ ├── ExceptionFormatterSpec.js
│ │ │ ├── EnvSpec.js
│ │ │ ├── ObjectContainingSpec.js
│ │ │ ├── SpySpec.js
│ │ │ └── CallTrackerSpec.js
│ │ ├── html
│ │ │ ├── HtmlSpecFilterSpec.js
│ │ │ ├── PrettyPrintHtmlSpec.js
│ │ │ ├── MatchersHtmlSpec.js
│ │ │ ├── QueryStringSpec.js
│ │ │ └── ResultsNodeSpec.js
│ │ └── javascripts
│ │ │ └── support
│ │ │ └── jasmine_selenium_runner.yml
│ ├── grunt
│ │ ├── config
│ │ │ ├── compass.js
│ │ │ ├── jshint.js
│ │ │ ├── concat.js
│ │ │ └── compress.js
│ │ ├── templates
│ │ │ ├── version.rb.jst
│ │ │ ├── SpecRunner.html.jst
│ │ │ └── licenseBanner.js.jst
│ │ └── tasks
│ │ │ ├── version.js
│ │ │ └── build_standalone.js
│ ├── Gemfile
│ ├── .gitignore
│ ├── travis-core-script.sh
│ ├── .npmignore
│ ├── .bower.json
│ ├── Rakefile
│ ├── package.json
│ ├── release_notes
│ │ ├── 2.0.2.md
│ │ └── 2.0.1.md
│ ├── jasmine-core.gemspec
│ ├── MIT.LICENSE
│ ├── .travis.yml
│ ├── Gruntfile.js
│ ├── setup.py
│ ├── GOALS_2.0.md
│ ├── RELEASE.md
│ └── README.md
└── bootstrap-3
│ ├── glyphicons-halflings-regular.eot
│ ├── glyphicons-halflings-regular.ttf
│ ├── glyphicons-halflings-regular.woff
│ └── bootstrap.less
├── .gitignore
├── dist
├── bootstrap-tagsinput.zip
├── bootstrap-tagsinput.less
├── bootstrap-tagsinput-typeahead.css
├── bootstrap-tagsinput-angular.min.js
├── bootstrap-tagsinput.css
├── bootstrap-tagsinput-angular.min.js.map
└── bootstrap-tagsinput-angular.js
├── .travis.yml
├── examples
└── assets
│ ├── citynames.json
│ ├── app.js
│ ├── cities.json
│ ├── app.css
│ ├── app_bs3.js
│ └── app_bs2.js
├── karma.conf.js
├── bootstrap-tagsinput.jquery.json
├── bower.json
├── LICENSE
├── src
├── bootstrap-tagsinput-typeahead.css
├── bootstrap-tagsinput.css
└── bootstrap-tagsinput-angular.js
├── test
├── helpers.js
├── bootstrap-tagsinput
│ ├── select_with_object_items.tests.js
│ ├── select_with_string_items.tests.js
│ └── events.tests.js
├── index.html
└── bootstrap-tagsinput-angular.tests.js
├── package.json
└── Gruntfile.js
/lib/jasmine/.rspec:
--------------------------------------------------------------------------------
1 | --color
2 |
--------------------------------------------------------------------------------
/lib/jasmine/images/__init__.py:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/lib/jasmine/requirements.txt:
--------------------------------------------------------------------------------
1 | ordereddict==1.1
2 |
--------------------------------------------------------------------------------
/lib/jasmine/lib/jasmine-core/__init__.py:
--------------------------------------------------------------------------------
1 | from .core import Core
--------------------------------------------------------------------------------
/lib/jasmine/src/html/jasmine.scss:
--------------------------------------------------------------------------------
1 | @import "HTMLReporter";
2 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | node_modules/
2 | bower_components/
3 | versioned
4 | lib/*
5 |
--------------------------------------------------------------------------------
/lib/jasmine/.gitmodules:
--------------------------------------------------------------------------------
1 | [submodule "pages"]
2 | path = pages
3 | url = https://github.com/pivotal/jasmine.git
4 |
--------------------------------------------------------------------------------
/lib/jasmine/src/version.js:
--------------------------------------------------------------------------------
1 | getJasmineRequireObj().version = function() {
2 | return '<%= version %>';
3 | };
4 |
--------------------------------------------------------------------------------
/dist/bootstrap-tagsinput.zip:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tweichart/bootstrap-tagsinput/master/dist/bootstrap-tagsinput.zip
--------------------------------------------------------------------------------
/lib/jasmine/travis-node-script.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash -e
2 |
3 | npm install -g grunt-cli
4 | npm install
5 |
6 | grunt execSpecsInNode
7 |
--------------------------------------------------------------------------------
/lib/jasmine/images/jasmine_favicon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tweichart/bootstrap-tagsinput/master/lib/jasmine/images/jasmine_favicon.png
--------------------------------------------------------------------------------
/lib/jasmine/images/jasmine-horizontal.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tweichart/bootstrap-tagsinput/master/lib/jasmine/images/jasmine-horizontal.png
--------------------------------------------------------------------------------
/lib/jasmine/dist/jasmine-standalone-1.0.0.zip:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tweichart/bootstrap-tagsinput/master/lib/jasmine/dist/jasmine-standalone-1.0.0.zip
--------------------------------------------------------------------------------
/lib/jasmine/dist/jasmine-standalone-1.1.0.zip:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tweichart/bootstrap-tagsinput/master/lib/jasmine/dist/jasmine-standalone-1.1.0.zip
--------------------------------------------------------------------------------
/lib/jasmine/dist/jasmine-standalone-1.2.0.zip:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tweichart/bootstrap-tagsinput/master/lib/jasmine/dist/jasmine-standalone-1.2.0.zip
--------------------------------------------------------------------------------
/lib/jasmine/dist/jasmine-standalone-1.3.0.zip:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tweichart/bootstrap-tagsinput/master/lib/jasmine/dist/jasmine-standalone-1.3.0.zip
--------------------------------------------------------------------------------
/lib/jasmine/dist/jasmine-standalone-1.3.1.zip:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tweichart/bootstrap-tagsinput/master/lib/jasmine/dist/jasmine-standalone-1.3.1.zip
--------------------------------------------------------------------------------
/lib/jasmine/dist/jasmine-standalone-2.0.0.zip:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tweichart/bootstrap-tagsinput/master/lib/jasmine/dist/jasmine-standalone-2.0.0.zip
--------------------------------------------------------------------------------
/lib/jasmine/dist/jasmine-standalone-2.0.1.zip:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tweichart/bootstrap-tagsinput/master/lib/jasmine/dist/jasmine-standalone-2.0.1.zip
--------------------------------------------------------------------------------
/lib/jasmine/dist/jasmine-standalone-2.0.2.zip:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tweichart/bootstrap-tagsinput/master/lib/jasmine/dist/jasmine-standalone-2.0.2.zip
--------------------------------------------------------------------------------
/lib/jasmine/dist/jasmine-standalone-2.0.3.zip:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tweichart/bootstrap-tagsinput/master/lib/jasmine/dist/jasmine-standalone-2.0.3.zip
--------------------------------------------------------------------------------
/lib/bootstrap-3/glyphicons-halflings-regular.eot:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tweichart/bootstrap-tagsinput/master/lib/bootstrap-3/glyphicons-halflings-regular.eot
--------------------------------------------------------------------------------
/lib/bootstrap-3/glyphicons-halflings-regular.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tweichart/bootstrap-tagsinput/master/lib/bootstrap-3/glyphicons-halflings-regular.ttf
--------------------------------------------------------------------------------
/lib/bootstrap-3/glyphicons-halflings-regular.woff:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tweichart/bootstrap-tagsinput/master/lib/bootstrap-3/glyphicons-halflings-regular.woff
--------------------------------------------------------------------------------
/lib/jasmine/MANIFEST.in:
--------------------------------------------------------------------------------
1 | recursive-include . *.py
2 | include lib/jasmine-core/*.js
3 | include lib/jasmine-core/*.css
4 | include images/*.png
5 | include package.json
6 |
--------------------------------------------------------------------------------
/lib/jasmine/.jshintrc:
--------------------------------------------------------------------------------
1 | {
2 | "bitwise": true,
3 | "curly": true,
4 | "immed": true,
5 | "newcap": true,
6 | "trailing": true,
7 | "loopfunc": true,
8 | "quotmark": "single"
9 | }
--------------------------------------------------------------------------------
/lib/jasmine/src/templates/version.rb.erb:
--------------------------------------------------------------------------------
1 | module Jasmine
2 | module Core
3 | VERSION = "<%= "#{major}.#{minor}.#{build}" %><%= ".rc#{release_candidate}" if release_candidate %>"
4 | end
5 | end
6 |
7 |
--------------------------------------------------------------------------------
/lib/jasmine/lib/jasmine-core/example/src/Song.js:
--------------------------------------------------------------------------------
1 | function Song() {
2 | }
3 |
4 | Song.prototype.persistFavoriteStatus = function(value) {
5 | // something complicated
6 | throw new Error("not yet implemented");
7 | };
--------------------------------------------------------------------------------
/lib/jasmine/travis-docs-script.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash -e
2 |
3 | git clone https://github.com/jasmine/jasmine.github.io.git
4 |
5 | bundle exec rake jasmine:ci JASMINE_CONFIG_PATH=jasmine.github.io/edge/spec/support/jasmine.yml
6 |
--------------------------------------------------------------------------------
/lib/jasmine/spec/support/jasmine-performance.yml:
--------------------------------------------------------------------------------
1 | src_dir:
2 | - 'src'
3 | src_files:
4 | - '**/*.js'
5 | helpers:
6 | - 'helpers/**/*.js'
7 | spec_files:
8 | - 'performance/performance_test.js'
9 | spec_dir: spec
10 |
--------------------------------------------------------------------------------
/lib/jasmine/spec/support/jasmine.json:
--------------------------------------------------------------------------------
1 | {
2 | "spec_dir": "spec",
3 | "spec_files": [
4 | "core/**/*.js",
5 | "console/**/*.js"
6 | ],
7 | "helpers": [
8 | "helpers/nodeDefineJasmineUnderTest.js"
9 | ]
10 | }
11 |
--------------------------------------------------------------------------------
/lib/jasmine/spec/support/jasmine-performance.json:
--------------------------------------------------------------------------------
1 | {
2 | "spec_dir": "spec",
3 | "spec_files": [
4 | "performance/performance_test.js"
5 | ],
6 | "helper_files": [
7 | "helpers/nodeDefineJasmineUnderTest.js"
8 | ]
9 | }
10 |
--------------------------------------------------------------------------------
/lib/jasmine/grunt/config/compass.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | jasmine: {
3 | options: {
4 | cssDir: 'lib/jasmine-core/',
5 | sassDir: 'src/html',
6 | outputStyle: 'compact',
7 | noLineComments: true,
8 | }
9 | }
10 | };
11 |
--------------------------------------------------------------------------------
/lib/jasmine/src/templates/version.js.erb:
--------------------------------------------------------------------------------
1 |
2 | jasmine.version_= {
3 | "major": <%= major %>,
4 | "minor": <%= minor %>,
5 | "build": <%= build %>,
6 | "revision": <%= revision %><%= %Q{,\n "release_candidate": #{release_candidate}} if release_candidate %>
7 | };
8 |
--------------------------------------------------------------------------------
/.travis.yml:
--------------------------------------------------------------------------------
1 | language: node_js
2 | node_js:
3 | - 0.10
4 |
5 | before_script:
6 | - export DISPLAY=:99.0
7 | - sh -e /etc/init.d/xvfb start
8 | - npm install
9 | - ./node_modules/.bin/grunt install
10 |
11 | script:
12 | - ./node_modules/.bin/grunt test
13 |
--------------------------------------------------------------------------------
/lib/jasmine/lib/jasmine-core/example/node_example/src/Song.js:
--------------------------------------------------------------------------------
1 | function Song() {
2 | }
3 |
4 | Song.prototype.persistFavoriteStatus = function(value) {
5 | // something complicated
6 | throw new Error("not yet implemented");
7 | };
8 |
9 | module.exports = Song;
10 |
--------------------------------------------------------------------------------
/lib/jasmine/grunt/config/jshint.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | beforeConcat: ['src/**/*.js'],
3 | afterConcat: [
4 | 'lib/jasmine-core/jasmine-html.js',
5 | 'lib/jasmine-core/jasmine.js'
6 | ],
7 | options: {
8 | jshintrc: '.jshintrc'
9 | },
10 | all: ['src/**/*.js']
11 | };
12 |
--------------------------------------------------------------------------------
/lib/jasmine/src/html/requireHtml.js:
--------------------------------------------------------------------------------
1 | jasmineRequire.html = function(j$) {
2 | j$.ResultsNode = jasmineRequire.ResultsNode();
3 | j$.HtmlReporter = jasmineRequire.HtmlReporter(j$);
4 | j$.QueryString = jasmineRequire.QueryString();
5 | j$.HtmlSpecFilter = jasmineRequire.HtmlSpecFilter();
6 | };
7 |
--------------------------------------------------------------------------------
/examples/assets/citynames.json:
--------------------------------------------------------------------------------
1 | [ "Amsterdam",
2 | "London",
3 | "Paris",
4 | "Washington",
5 | "New York",
6 | "Los Angeles",
7 | "Sydney",
8 | "Melbourne",
9 | "Canberra",
10 | "Beijing",
11 | "New Delhi",
12 | "Kathmandu",
13 | "Cairo",
14 | "Cape Town",
15 | "Kinshasa"
16 | ]
--------------------------------------------------------------------------------
/lib/jasmine/lib/jasmine-core/version.rb:
--------------------------------------------------------------------------------
1 | #
2 | # DO NOT Edit this file. Canonical version of Jasmine lives in the repo's package.json. This file is generated
3 | # by a grunt task when the standalone release is built.
4 | #
5 | module Jasmine
6 | module Core
7 | VERSION = "2.0.4"
8 | end
9 | end
10 |
--------------------------------------------------------------------------------
/lib/jasmine/src/core/matchers/toBe.js:
--------------------------------------------------------------------------------
1 | getJasmineRequireObj().toBe = function() {
2 | function toBe() {
3 | return {
4 | compare: function(actual, expected) {
5 | return {
6 | pass: actual === expected
7 | };
8 | }
9 | };
10 | }
11 |
12 | return toBe;
13 | };
14 |
--------------------------------------------------------------------------------
/lib/jasmine/src/core/matchers/toBeFalsy.js:
--------------------------------------------------------------------------------
1 | getJasmineRequireObj().toBeFalsy = function() {
2 | function toBeFalsy() {
3 | return {
4 | compare: function(actual) {
5 | return {
6 | pass: !!!actual
7 | };
8 | }
9 | };
10 | }
11 |
12 | return toBeFalsy;
13 | };
14 |
--------------------------------------------------------------------------------
/lib/jasmine/spec/performance/performance_test.js:
--------------------------------------------------------------------------------
1 | describe("performance", function() {
2 | for (var i = 0; i < 10000; i++) {
3 | it("should pass", function() {
4 | expect(true).toBe(true);
5 | });
6 | it("should fail", function() {
7 | expect(true).toBe(false);
8 | });
9 | }
10 | });
11 |
--------------------------------------------------------------------------------
/lib/jasmine/src/core/matchers/toBeNull.js:
--------------------------------------------------------------------------------
1 | getJasmineRequireObj().toBeNull = function() {
2 |
3 | function toBeNull() {
4 | return {
5 | compare: function(actual) {
6 | return {
7 | pass: actual === null
8 | };
9 | }
10 | };
11 | }
12 |
13 | return toBeNull;
14 | };
15 |
--------------------------------------------------------------------------------
/lib/jasmine/Gemfile:
--------------------------------------------------------------------------------
1 | source 'https://rubygems.org'
2 | gem "jasmine", :git => 'https://github.com/pivotal/jasmine-gem.git'
3 | # gem "jasmine", path: "/Users/pivotal/workspace/jasmine-gem"
4 | unless ENV["TRAVIS"]
5 | group :debug do
6 | gem 'debugger'
7 | end
8 | end
9 |
10 | gemspec
11 |
12 | gem "anchorman"
13 |
--------------------------------------------------------------------------------
/lib/jasmine/grunt/templates/version.rb.jst:
--------------------------------------------------------------------------------
1 | #
2 | # DO NOT Edit this file. Canonical version of Jasmine lives in the repo's package.json. This file is generated
3 | # by a grunt task when the standalone release is built.
4 | #
5 | module Jasmine
6 | module Core
7 | VERSION = "<%= jasmineVersion %>"
8 | end
9 | end
10 |
--------------------------------------------------------------------------------
/lib/jasmine/src/core/matchers/toBeTruthy.js:
--------------------------------------------------------------------------------
1 | getJasmineRequireObj().toBeTruthy = function() {
2 |
3 | function toBeTruthy() {
4 | return {
5 | compare: function(actual) {
6 | return {
7 | pass: !!actual
8 | };
9 | }
10 | };
11 | }
12 |
13 | return toBeTruthy;
14 | };
15 |
--------------------------------------------------------------------------------
/lib/jasmine/src/core/matchers/toBeDefined.js:
--------------------------------------------------------------------------------
1 | getJasmineRequireObj().toBeDefined = function() {
2 | function toBeDefined() {
3 | return {
4 | compare: function(actual) {
5 | return {
6 | pass: (void 0 !== actual)
7 | };
8 | }
9 | };
10 | }
11 |
12 | return toBeDefined;
13 | };
14 |
--------------------------------------------------------------------------------
/lib/jasmine/src/core/matchers/toBeLessThan.js:
--------------------------------------------------------------------------------
1 | getJasmineRequireObj().toBeLessThan = function() {
2 | function toBeLessThan() {
3 | return {
4 |
5 | compare: function(actual, expected) {
6 | return {
7 | pass: actual < expected
8 | };
9 | }
10 | };
11 | }
12 |
13 | return toBeLessThan;
14 | };
--------------------------------------------------------------------------------
/lib/jasmine/src/core/matchers/toBeUndefined.js:
--------------------------------------------------------------------------------
1 | getJasmineRequireObj().toBeUndefined = function() {
2 |
3 | function toBeUndefined() {
4 | return {
5 | compare: function(actual) {
6 | return {
7 | pass: void 0 === actual
8 | };
9 | }
10 | };
11 | }
12 |
13 | return toBeUndefined;
14 | };
15 |
--------------------------------------------------------------------------------
/lib/jasmine/src/templates/example_project_jasmine_tags.html.erb:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/lib/jasmine/spec/helpers/defineJasmineUnderTest.js:
--------------------------------------------------------------------------------
1 | (function() {
2 | // By the time onload is called, jasmineRequire will be redefined to point
3 | // to the Jasmine source files (and not jasmine.js). So re-require
4 | window.j$ = jasmineRequire.core(jasmineRequire);
5 | jasmineRequire.html(j$);
6 | jasmineRequire.console(jasmineRequire, j$);
7 | })();
8 |
--------------------------------------------------------------------------------
/lib/jasmine/src/core/matchers/toBeGreaterThan.js:
--------------------------------------------------------------------------------
1 | getJasmineRequireObj().toBeGreaterThan = function() {
2 |
3 | function toBeGreaterThan() {
4 | return {
5 | compare: function(actual, expected) {
6 | return {
7 | pass: actual > expected
8 | };
9 | }
10 | };
11 | }
12 |
13 | return toBeGreaterThan;
14 | };
15 |
16 |
--------------------------------------------------------------------------------
/lib/jasmine/.gitignore:
--------------------------------------------------------------------------------
1 | .idea/
2 | .svn/
3 | .DS_Store
4 | site/
5 | .bundle/
6 | .pairs
7 | .rvmrc
8 | .ruby-gemset
9 | .ruby-version
10 | *.gem
11 | .bundle
12 | tags
13 | Gemfile.lock
14 | pkg/*
15 | .sass-cache/*
16 | src/html/.sass-cache/*
17 | node_modules/
18 | *.pyc
19 | sauce_connect.log
20 | *.swp
21 | build/
22 | *.egg-info/
23 | dist/*.tar.gz
24 | nbproject/
25 |
--------------------------------------------------------------------------------
/lib/jasmine/travis-core-script.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash -e
2 |
3 | if [ $USE_SAUCE == true ]
4 | then
5 | if [ $TRAVIS_SECURE_ENV_VARS == true ]
6 | then
7 | curl -L https://gist.github.com/santiycr/5139565/raw/sauce_connect_setup.sh | bash
8 | else
9 | echo "skipping tests since we can't use sauce"
10 | exit 0
11 | fi
12 | fi
13 |
14 | bundle exec rake jasmine:ci
15 |
--------------------------------------------------------------------------------
/lib/jasmine/src/core/matchers/toMatch.js:
--------------------------------------------------------------------------------
1 | getJasmineRequireObj().toMatch = function() {
2 |
3 | function toMatch() {
4 | return {
5 | compare: function(actual, expected) {
6 | var regexp = new RegExp(expected);
7 |
8 | return {
9 | pass: regexp.test(actual)
10 | };
11 | }
12 | };
13 | }
14 |
15 | return toMatch;
16 | };
17 |
--------------------------------------------------------------------------------
/lib/jasmine/.npmignore:
--------------------------------------------------------------------------------
1 | dist/
2 | grunt/
3 | node_modules
4 | release_notes/
5 | spec/
6 | src/
7 | Gemfile
8 | Gemfile.lock
9 | Rakefile
10 | jasmine-core.gemspec
11 | .rspec
12 | .travis.yml
13 | .jshintrc
14 | .gitignore
15 | *.sh
16 | Gruntfile.js
17 | lib/jasmine-core.rb
18 | lib/jasmine-core/boot/
19 | lib/jasmine-core/spec
20 | lib/jasmine-core/version.rb
21 | lib/jasmine-core/*.py
22 |
--------------------------------------------------------------------------------
/lib/jasmine/src/console/requireConsole.js:
--------------------------------------------------------------------------------
1 | function getJasmineRequireObj() {
2 | if (typeof module !== 'undefined' && module.exports) {
3 | return exports;
4 | } else {
5 | window.jasmineRequire = window.jasmineRequire || {};
6 | return window.jasmineRequire;
7 | }
8 | }
9 |
10 | getJasmineRequireObj().console = function(jRequire, j$) {
11 | j$.ConsoleReporter = jRequire.ConsoleReporter();
12 | };
13 |
--------------------------------------------------------------------------------
/lib/jasmine/.bower.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "jasmine",
3 | "homepage": "https://github.com/pivotal/jasmine",
4 | "version": "2.0.4",
5 | "_release": "2.0.4",
6 | "_resolution": {
7 | "type": "version",
8 | "tag": "v2.0.4",
9 | "commit": "d1b4a64a573d69f6cfd07c862a34402efdd0ea06"
10 | },
11 | "_source": "git://github.com/pivotal/jasmine.git",
12 | "_target": "~2.0.1",
13 | "_originalSource": "jasmine"
14 | }
--------------------------------------------------------------------------------
/lib/jasmine/lib/jasmine-core/example/spec/SpecHelper.js:
--------------------------------------------------------------------------------
1 | beforeEach(function () {
2 | jasmine.addMatchers({
3 | toBePlaying: function () {
4 | return {
5 | compare: function (actual, expected) {
6 | var player = actual;
7 |
8 | return {
9 | pass: player.currentlyPlayingSong === expected && player.isPlaying
10 | }
11 | }
12 | };
13 | }
14 | });
15 | });
16 |
--------------------------------------------------------------------------------
/lib/jasmine/lib/jasmine-core/example/node_example/spec/SpecHelper.js:
--------------------------------------------------------------------------------
1 | beforeEach(function () {
2 | jasmine.addMatchers({
3 | toBePlaying: function () {
4 | return {
5 | compare: function (actual, expected) {
6 | var player = actual;
7 |
8 | return {
9 | pass: player.currentlyPlayingSong === expected && player.isPlaying
10 | }
11 | }
12 | };
13 | }
14 | });
15 | });
16 |
--------------------------------------------------------------------------------
/lib/jasmine/src/core/matchers/toContain.js:
--------------------------------------------------------------------------------
1 | getJasmineRequireObj().toContain = function() {
2 | function toContain(util, customEqualityTesters) {
3 | customEqualityTesters = customEqualityTesters || [];
4 |
5 | return {
6 | compare: function(actual, expected) {
7 |
8 | return {
9 | pass: util.contains(actual, expected, customEqualityTesters)
10 | };
11 | }
12 | };
13 | }
14 |
15 | return toContain;
16 | };
17 |
--------------------------------------------------------------------------------
/lib/jasmine/src/html/HtmlSpecFilter.js:
--------------------------------------------------------------------------------
1 | jasmineRequire.HtmlSpecFilter = function() {
2 | function HtmlSpecFilter(options) {
3 | var filterString = options && options.filterString() && options.filterString().replace(/[-[\]{}()*+?.,\\^$|#\s]/g, '\\$&');
4 | var filterPattern = new RegExp(filterString);
5 |
6 | this.matches = function(specName) {
7 | return filterPattern.test(specName);
8 | };
9 | }
10 |
11 | return HtmlSpecFilter;
12 | };
13 |
--------------------------------------------------------------------------------
/lib/jasmine/Rakefile:
--------------------------------------------------------------------------------
1 | require "bundler"
2 | Bundler::GemHelper.install_tasks
3 | require "json"
4 | require "jasmine"
5 | unless ENV["JASMINE_BROWSER"] == 'phantomjs'
6 | require "jasmine_selenium_runner"
7 | end
8 | load "jasmine/tasks/jasmine.rake"
9 |
10 | namespace :jasmine do
11 | task :set_env do
12 | ENV['JASMINE_CONFIG_PATH'] ||= 'spec/support/jasmine.yml'
13 | end
14 | end
15 |
16 | task "jasmine:configure" => "jasmine:set_env"
17 |
18 | task :default => "jasmine:ci"
19 |
--------------------------------------------------------------------------------
/lib/jasmine/src/core/matchers/toBeCloseTo.js:
--------------------------------------------------------------------------------
1 | getJasmineRequireObj().toBeCloseTo = function() {
2 |
3 | function toBeCloseTo() {
4 | return {
5 | compare: function(actual, expected, precision) {
6 | if (precision !== 0) {
7 | precision = precision || 2;
8 | }
9 |
10 | return {
11 | pass: Math.abs(expected - actual) < (Math.pow(10, -precision) / 2)
12 | };
13 | }
14 | };
15 | }
16 |
17 | return toBeCloseTo;
18 | };
19 |
--------------------------------------------------------------------------------
/lib/jasmine/spec/core/matchers/toBeNullSpec.js:
--------------------------------------------------------------------------------
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 | });
18 |
--------------------------------------------------------------------------------
/lib/jasmine/spec/core/matchers/toBeSpec.js:
--------------------------------------------------------------------------------
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 | });
18 |
--------------------------------------------------------------------------------
/lib/jasmine/grunt/tasks/version.js:
--------------------------------------------------------------------------------
1 | var grunt = require("grunt");
2 |
3 | function gemLib(path) { return './lib/jasmine-core/' + path; }
4 | function nodeToRuby(version) { return version.replace('-', '.'); }
5 |
6 | module.exports = {
7 | copyToGem: function() {
8 | var versionRb = grunt.template.process(
9 | grunt.file.read("grunt/templates/version.rb.jst"),
10 | { data: { jasmineVersion: nodeToRuby(global.jasmineVersion) }});
11 |
12 | grunt.file.write(gemLib("version.rb"), versionRb);
13 | }
14 | };
15 |
--------------------------------------------------------------------------------
/lib/jasmine/src/core/matchers/toEqual.js:
--------------------------------------------------------------------------------
1 | getJasmineRequireObj().toEqual = function() {
2 |
3 | function toEqual(util, customEqualityTesters) {
4 | customEqualityTesters = customEqualityTesters || [];
5 |
6 | return {
7 | compare: function(actual, expected) {
8 | var result = {
9 | pass: false
10 | };
11 |
12 | result.pass = util.equals(actual, expected, customEqualityTesters);
13 |
14 | return result;
15 | }
16 | };
17 | }
18 |
19 | return toEqual;
20 | };
21 |
--------------------------------------------------------------------------------
/lib/jasmine/src/html/ResultsNode.js:
--------------------------------------------------------------------------------
1 | jasmineRequire.ResultsNode = function() {
2 | function ResultsNode(result, type, parent) {
3 | this.result = result;
4 | this.type = type;
5 | this.parent = parent;
6 |
7 | this.children = [];
8 |
9 | this.addChild = function(result, type) {
10 | this.children.push(new ResultsNode(result, type, this));
11 | };
12 |
13 | this.last = function() {
14 | return this.children[this.children.length - 1];
15 | };
16 | }
17 |
18 | return ResultsNode;
19 | };
20 |
--------------------------------------------------------------------------------
/lib/jasmine/spec/core/matchers/toBeDefinedSpec.js:
--------------------------------------------------------------------------------
1 | describe("toBeDefined", function() {
2 | it("matches for defined values", function() {
3 | var matcher = j$.matchers.toBeDefined(),
4 | result;
5 |
6 |
7 | result = matcher.compare('foo');
8 | expect(result.pass).toBe(true);
9 | });
10 |
11 | it("fails when matching undefined values", function() {
12 | var matcher = j$.matchers.toBeDefined(),
13 | result;
14 |
15 | result = matcher.compare(void 0);
16 | expect(result.pass).toBe(false);
17 | })
18 | });
19 |
--------------------------------------------------------------------------------
/lib/jasmine/src/core/Timer.js:
--------------------------------------------------------------------------------
1 | getJasmineRequireObj().Timer = function() {
2 | var defaultNow = (function(Date) {
3 | return function() { return new Date().getTime(); };
4 | })(Date);
5 |
6 | function Timer(options) {
7 | options = options || {};
8 |
9 | var now = options.now || defaultNow,
10 | startTime;
11 |
12 | this.start = function() {
13 | startTime = now();
14 | };
15 |
16 | this.elapsed = function() {
17 | return now() - startTime;
18 | };
19 | }
20 |
21 | return Timer;
22 | };
23 |
--------------------------------------------------------------------------------
/lib/jasmine/spec/core/matchers/toBeUndefinedSpec.js:
--------------------------------------------------------------------------------
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 | });
19 |
--------------------------------------------------------------------------------
/karma.conf.js:
--------------------------------------------------------------------------------
1 | module.exports = function(config) {
2 |
3 | config.set({
4 | basePath: '',
5 | frameworks: ['jasmine'],
6 | files: [
7 | 'lib/jquery/jquery.js',
8 | 'lib/angular/angular.js',
9 | 'dist/bootstrap-tagsinput.min.js',
10 | 'dist/bootstrap-tagsinput-angular.min.js',
11 | 'test/helpers.js',
12 | { pattern: 'test/bootstrap-tagsinput/*.tests.js' }
13 | ],
14 | reporters: ['progress'],
15 | port: 9876,
16 | logLevel: config.LOG_DEBUG,
17 | captureTimeout: 60000
18 | });
19 |
20 | };
21 |
--------------------------------------------------------------------------------
/lib/jasmine/lib/jasmine-core/example/src/Player.js:
--------------------------------------------------------------------------------
1 | function Player() {
2 | }
3 | Player.prototype.play = function(song) {
4 | this.currentlyPlayingSong = song;
5 | this.isPlaying = true;
6 | };
7 |
8 | Player.prototype.pause = function() {
9 | this.isPlaying = false;
10 | };
11 |
12 | Player.prototype.resume = function() {
13 | if (this.isPlaying) {
14 | throw new Error("song is already playing");
15 | }
16 |
17 | this.isPlaying = true;
18 | };
19 |
20 | Player.prototype.makeFavorite = function() {
21 | this.currentlyPlayingSong.persistFavoriteStatus(true);
22 | };
--------------------------------------------------------------------------------
/examples/assets/app.js:
--------------------------------------------------------------------------------
1 | $(function() {
2 | $('input, select').on('change', function(event) {
3 | var $element = $(event.target),
4 | $container = $element.closest('.example');
5 |
6 | if (!$element.data('tagsinput'))
7 | return;
8 |
9 | var val = $element.val();
10 | if (val === null)
11 | val = "null";
12 | $('code', $('pre.val', $container)).html( ($.isArray(val) ? JSON.stringify(val) : "\"" + val.replace('"', '\\"') + "\"") );
13 | $('code', $('pre.items', $container)).html(JSON.stringify($element.tagsinput('items')));
14 | }).trigger('change');
15 | });
--------------------------------------------------------------------------------
/lib/jasmine/src/core/matchers/toBeNaN.js:
--------------------------------------------------------------------------------
1 | getJasmineRequireObj().toBeNaN = function(j$) {
2 |
3 | function toBeNaN() {
4 | return {
5 | compare: function(actual) {
6 | var result = {
7 | pass: (actual !== actual)
8 | };
9 |
10 | if (result.pass) {
11 | result.message = 'Expected actual not to be NaN.';
12 | } else {
13 | result.message = function() { return 'Expected ' + j$.pp(actual) + ' to be NaN.'; };
14 | }
15 |
16 | return result;
17 | }
18 | };
19 | }
20 |
21 | return toBeNaN;
22 | };
23 |
--------------------------------------------------------------------------------
/lib/jasmine/lib/jasmine-core/boot/node_boot.js:
--------------------------------------------------------------------------------
1 | module.exports = function(jasmineRequire) {
2 | var jasmine = jasmineRequire.core(jasmineRequire);
3 |
4 | var consoleFns = require('../console/console.js');
5 | consoleFns.console(consoleFns, jasmine);
6 |
7 | var env = jasmine.getEnv();
8 |
9 | var jasmineInterface = jasmineRequire.interface(jasmine, env);
10 |
11 | extend(global, jasmineInterface);
12 |
13 | function extend(destination, source) {
14 | for (var property in source) destination[property] = source[property];
15 | return destination;
16 | }
17 |
18 | return jasmine;
19 | };
20 |
--------------------------------------------------------------------------------
/lib/jasmine/spec/core/matchers/toBeLessThanSpec.js:
--------------------------------------------------------------------------------
1 | describe("toBeLessThan", function() {
2 | it("passes when actual < expected", function() {
3 | var matcher = j$.matchers.toBeLessThan(),
4 | result;
5 |
6 | result = matcher.compare(1, 2);
7 | expect(result.pass).toBe(true);
8 | });
9 |
10 | it("fails when actual <= expected", function() {
11 | var matcher = j$.matchers.toBeLessThan(),
12 | result;
13 |
14 | result = matcher.compare(1, 1);
15 | expect(result.pass).toBe(false);
16 |
17 | result = matcher.compare(2, 1);
18 | expect(result.pass).toBe(false);
19 | });
20 | });
21 |
--------------------------------------------------------------------------------
/lib/jasmine/lib/jasmine-core/example/node_example/src/Player.js:
--------------------------------------------------------------------------------
1 | function Player() {
2 | }
3 | Player.prototype.play = function(song) {
4 | this.currentlyPlayingSong = song;
5 | this.isPlaying = true;
6 | };
7 |
8 | Player.prototype.pause = function() {
9 | this.isPlaying = false;
10 | };
11 |
12 | Player.prototype.resume = function() {
13 | if (this.isPlaying) {
14 | throw new Error("song is already playing");
15 | }
16 |
17 | this.isPlaying = true;
18 | };
19 |
20 | Player.prototype.makeFavorite = function() {
21 | this.currentlyPlayingSong.persistFavoriteStatus(true);
22 | };
23 |
24 | module.exports = Player;
25 |
--------------------------------------------------------------------------------
/lib/jasmine/spec/core/matchers/toBeGreaterThanSpec.js:
--------------------------------------------------------------------------------
1 | describe("toBeGreaterThan", function() {
2 | it("passes when actual > expected", function() {
3 | var matcher = j$.matchers.toBeGreaterThan(),
4 | result;
5 |
6 | result = matcher.compare(2, 1);
7 | expect(result.pass).toBe(true);
8 | });
9 |
10 | it("fails when actual <= expected", function() {
11 | var matcher = j$.matchers.toBeGreaterThan(),
12 | result;
13 |
14 | result = matcher.compare(1, 1);
15 | expect(result.pass).toBe(false);
16 |
17 | result = matcher.compare(1, 2);
18 | expect(result.pass).toBe(false);
19 | });
20 | });
21 |
--------------------------------------------------------------------------------
/lib/jasmine/spec/html/HtmlSpecFilterSpec.js:
--------------------------------------------------------------------------------
1 | describe("j$.HtmlSpecFilter", function() {
2 |
3 | it("should match when no string is provided", function() {
4 | var specFilter = new j$.HtmlSpecFilter();
5 |
6 | expect(specFilter.matches("foo")).toBe(true);
7 | expect(specFilter.matches("*bar")).toBe(true);
8 | });
9 |
10 | it("should only match the provided string", function() {
11 | var specFilter = new j$.HtmlSpecFilter({
12 | filterString: function() { return "foo"; }
13 | });
14 |
15 | expect(specFilter.matches("foo")).toBe(true);
16 | expect(specFilter.matches("bar")).toBe(false);
17 | });
18 | });
19 |
--------------------------------------------------------------------------------
/lib/jasmine/spec/javascripts/support/jasmine_selenium_runner.yml:
--------------------------------------------------------------------------------
1 | ---
2 | use_sauce: <%= ENV['USE_SAUCE'] %>
3 | browser: <%= ENV['JASMINE_BROWSER'] %>
4 | sauce:
5 | name: jasmine-core <%= Time.now.to_s %>
6 | username: <%= ENV['SAUCE_USERNAME'] %>
7 | access_key: <%= ENV['SAUCE_ACCESS_KEY'] %>
8 | build: <%= ENV['TRAVIS_BUILD_NUMBER'] || 'Ran locally' %>
9 | tags:
10 | - <%= ENV['TRAVIS_RUBY_VERSION'] || RUBY_VERSION %>
11 | - CI
12 | tunnel_identifier: <%= ENV['TRAVIS_JOB_NUMBER'] ? %Q("#{ENV['TRAVIS_JOB_NUMBER']}") : nil %>
13 | os: <%= ENV['SAUCE_OS'] %>
14 | browser_version: <%= ENV['SAUCE_BROWSER_VERSION'] %>
15 |
16 |
17 |
--------------------------------------------------------------------------------
/lib/jasmine/spec/support/jasmine.yml:
--------------------------------------------------------------------------------
1 | #This 'magic' inclusion order allows the travis build to pass.
2 | #TODO: search for the correct files to include to prevent
3 | src_dir:
4 | - 'src'
5 | src_files:
6 | - 'core/base.js'
7 | - 'core/util.js'
8 | #end of known dependencies
9 | - 'core/Spec.js'
10 | - 'core/Env.js'
11 | - 'core/JsApiReporter.js'
12 | - 'core/PrettyPrinter.js'
13 | - 'core/Suite.js'
14 | - 'core/**/*.js'
15 | - 'html/**.js'
16 | - '**/*.js'
17 | stylesheets:
18 | helpers:
19 | - 'helpers/BrowserFlags.js'
20 | - 'helpers/defineJasmineUnderTest.js'
21 | spec_files:
22 | - '**/*[Ss]pec.js'
23 | spec_dir: spec
24 |
25 |
26 |
--------------------------------------------------------------------------------
/lib/jasmine/spec/html/PrettyPrintHtmlSpec.js:
--------------------------------------------------------------------------------
1 | describe("j$.pp (HTML Dependent)", function () {
2 | it("should stringify HTML nodes properly", function() {
3 | var sampleNode = document.createElement('div');
4 | sampleNode.innerHTML = 'foobar';
5 | expect(j$.pp(sampleNode)).toEqual("HTMLNode");
6 | expect(j$.pp({foo: sampleNode})).toEqual("{ foo: HTMLNode }");
7 | });
8 |
9 | it("should print Firefox's wrapped native objects correctly", function() {
10 | if(jasmine.getEnv().firefoxVersion) {
11 | try { new CustomEvent(); } catch(e) { var err = e; };
12 | expect(j$.pp(err)).toMatch(/Not enough arguments/);
13 | }
14 | });
15 | });
16 |
--------------------------------------------------------------------------------
/lib/jasmine/spec/helpers/BrowserFlags.js:
--------------------------------------------------------------------------------
1 | (function(env) {
2 | function browserVersion(matchFn) {
3 | var userAgent = jasmine.getGlobal().navigator.userAgent;
4 | if (!userAgent) { return void 0; }
5 |
6 | var match = matchFn(userAgent);
7 |
8 | return match ? parseFloat(match[1]) : void 0;
9 | }
10 |
11 | env.ieVersion = browserVersion(function(userAgent) {
12 | return /MSIE ([0-9]{1,}[\.0-9]{0,})/.exec(userAgent);
13 | });
14 |
15 | env.safariVersion = browserVersion(function(userAgent) {
16 | return /Safari/.exec(userAgent) && /Version\/([0-9]{0,})/.exec(userAgent);
17 | });
18 |
19 | env.firefoxVersion = browserVersion(function(userAgent) {
20 | return /Firefox\/([0-9]{0,})/.exec(userAgent);
21 | });
22 |
23 | })(jasmine.getEnv());
24 |
--------------------------------------------------------------------------------
/bootstrap-tagsinput.jquery.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "bootstrap-tagsinput",
3 | "version": "0.8.0",
4 | "title": "Bootstrap Tags Input",
5 | "author": {
6 | "name": "Tim Schlechter"
7 | },
8 | "licenses": [
9 | {
10 | "type": "MIT",
11 | "url": "http://opensource.org/licenses/MIT"
12 | }
13 | ],
14 | "dependencies": {
15 | "jquery": "*"
16 | },
17 | "description": "jQuery plugin providing a Twitter Bootstrap user interface for managing tags.",
18 | "keywords": [
19 | "tags",
20 | "bootstrap",
21 | "input",
22 | "select",
23 | "form"
24 | ],
25 | "download": "http://timschlechter.github.io/bootstrap-tagsinput/build/bootstrap-tagsinput.zip",
26 | "homepage": "http://timschlechter.github.io/bootstrap-tagsinput/examples/"
27 | }
--------------------------------------------------------------------------------
/lib/jasmine/src/core/matchers/requireMatchers.js:
--------------------------------------------------------------------------------
1 | getJasmineRequireObj().requireMatchers = function(jRequire, j$) {
2 | var availableMatchers = [
3 | 'toBe',
4 | 'toBeCloseTo',
5 | 'toBeDefined',
6 | 'toBeFalsy',
7 | 'toBeGreaterThan',
8 | 'toBeLessThan',
9 | 'toBeNaN',
10 | 'toBeNull',
11 | 'toBeTruthy',
12 | 'toBeUndefined',
13 | 'toContain',
14 | 'toEqual',
15 | 'toHaveBeenCalled',
16 | 'toHaveBeenCalledWith',
17 | 'toMatch',
18 | 'toThrow',
19 | 'toThrowError'
20 | ],
21 | matchers = {};
22 |
23 | for (var i = 0; i < availableMatchers.length; i++) {
24 | var name = availableMatchers[i];
25 | matchers[name] = jRequire[name](j$);
26 | }
27 |
28 | return matchers;
29 | };
30 |
--------------------------------------------------------------------------------
/lib/jasmine/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "jasmine-core",
3 | "license": "MIT",
4 | "version": "2.0.4",
5 | "repository": {
6 | "type": "git",
7 | "url": "https://github.com/pivotal/jasmine.git"
8 | },
9 | "description": "Official packaging of Jasmine's core files for use by Node.js projects.",
10 | "homepage": "http://jasmine.github.io",
11 | "main": "./lib/jasmine-core.js",
12 | "devDependencies": {
13 | "grunt": "~0.4.1",
14 | "grunt-contrib-jshint": "~0.7.0",
15 | "grunt-contrib-concat": "~0.3.0",
16 | "grunt-contrib-compass": "~0.6.0",
17 | "grunt-contrib-compress": "~0.5.2",
18 | "shelljs": "~0.1.4",
19 | "glob": "~3.2.9",
20 | "jasmine": "https://github.com/pivotal/jasmine-npm/archive/master.tar.gz",
21 | "load-grunt-tasks": "^0.4.0"
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/lib/jasmine/release_notes/2.0.2.md:
--------------------------------------------------------------------------------
1 | # Release Notes
2 |
3 | ## Summary
4 |
5 | ## Changes
6 |
7 | * keep the files for running in a webpage around in the npm package
8 | * Expose files and paths necessary to embed jasmine in an html page for nodejs
9 | * Pull out the building of the jasmine interface so node and web both get the same one.
10 | * Show a dot with color of pending spec when no expectations
11 | * Console reporter prints out failed expectation's message
12 |
13 | ### Bugs
14 |
15 | * Allow mocked Date constructor to be called with a subset of full params
16 |
17 | ## Pull Requests and Issues
18 |
19 | * a disabled suite should call resultCallback with status being disabled
20 | * disabled suite should still call onStart callback
21 |
22 |
23 | ------
24 |
25 | _Release Notes generated with _[Anchorman](http://github.com/infews/anchorman)_
26 |
--------------------------------------------------------------------------------
/lib/jasmine/src/core/ExceptionFormatter.js:
--------------------------------------------------------------------------------
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 | };
30 |
--------------------------------------------------------------------------------
/lib/jasmine/src/core/matchers/toHaveBeenCalled.js:
--------------------------------------------------------------------------------
1 | getJasmineRequireObj().toHaveBeenCalled = function(j$) {
2 |
3 | function toHaveBeenCalled() {
4 | return {
5 | compare: function(actual) {
6 | var result = {};
7 |
8 | if (!j$.isSpy(actual)) {
9 | throw new Error('Expected a spy, but got ' + j$.pp(actual) + '.');
10 | }
11 |
12 | if (arguments.length > 1) {
13 | throw new Error('toHaveBeenCalled does not take arguments, use toHaveBeenCalledWith');
14 | }
15 |
16 | result.pass = actual.calls.any();
17 |
18 | result.message = result.pass ?
19 | 'Expected spy ' + actual.and.identity() + ' not to have been called.' :
20 | 'Expected spy ' + actual.and.identity() + ' to have been called.';
21 |
22 | return result;
23 | }
24 | };
25 | }
26 |
27 | return toHaveBeenCalled;
28 | };
29 |
--------------------------------------------------------------------------------
/lib/jasmine/spec/core/TimerSpec.js:
--------------------------------------------------------------------------------
1 | describe("Timer", function() {
2 | it("reports the time elapsed", function() {
3 | var fakeNow = jasmine.createSpy('fake Date.now'),
4 | timer = new j$.Timer({now: fakeNow});
5 |
6 | fakeNow.and.returnValue(100);
7 | timer.start();
8 |
9 | fakeNow.and.returnValue(200);
10 |
11 | expect(timer.elapsed()).toEqual(100);
12 | });
13 |
14 | describe("when date is stubbed, perhaps by other testing helpers", function() {
15 | var origDate = Date;
16 | beforeEach(function() {
17 | Date = jasmine.createSpy('date spy');
18 | });
19 |
20 | afterEach(function() {
21 | Date = origDate;
22 | });
23 |
24 | it("does not throw even though Date was taken away", function() {
25 | var timer = new j$.Timer();
26 |
27 | expect(timer.start).not.toThrow();
28 | expect(timer.elapsed()).toEqual(jasmine.any(Number));
29 | });
30 | });
31 | });
32 |
--------------------------------------------------------------------------------
/lib/jasmine/spec/performance/large_object_test.js:
--------------------------------------------------------------------------------
1 | describe('Printing a big object', function(){
2 | var bigObject;
3 | function rand(upper) {
4 | return Math.round(upper * Math.random());
5 | }
6 |
7 | function generateObject(level) {
8 | var object = {};
9 |
10 | for (var i = 0; i < 50; i++) {
11 | var decide = rand(2);
12 | switch (decide) {
13 | case 0:
14 | object["cycle" + i] = object;
15 | break;
16 | case 1:
17 | object["number" + i] = rand(100);
18 | break;
19 | case 2:
20 | if (level < 3) {
21 | object["nesting" + i] = generateObject(level + 1);
22 | }
23 | break;
24 | }
25 |
26 | }
27 |
28 | return object;
29 | }
30 |
31 | it('takes a resonable amount of time', function(){
32 | bigObject = generateObject(0);
33 | expect(j$.pp(bigObject)).toMatch(/cycle/);
34 | });
35 | });
36 |
37 |
--------------------------------------------------------------------------------
/lib/jasmine/src/core/ReportDispatcher.js:
--------------------------------------------------------------------------------
1 | getJasmineRequireObj().ReportDispatcher = function() {
2 | function ReportDispatcher(methods) {
3 |
4 | var dispatchedMethods = methods || [];
5 |
6 | for (var i = 0; i < dispatchedMethods.length; i++) {
7 | var method = dispatchedMethods[i];
8 | this[method] = (function(m) {
9 | return function() {
10 | dispatch(m, arguments);
11 | };
12 | }(method));
13 | }
14 |
15 | var reporters = [];
16 |
17 | this.addReporter = function(reporter) {
18 | reporters.push(reporter);
19 | };
20 |
21 | return this;
22 |
23 | function dispatch(method, args) {
24 | for (var i = 0; i < reporters.length; i++) {
25 | var reporter = reporters[i];
26 | if (reporter[method]) {
27 | reporter[method].apply(reporter, args);
28 | }
29 | }
30 | }
31 | }
32 |
33 | return ReportDispatcher;
34 | };
35 |
36 |
--------------------------------------------------------------------------------
/lib/jasmine/spec/core/matchers/toEqualSpec.js:
--------------------------------------------------------------------------------
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 | });
29 |
--------------------------------------------------------------------------------
/lib/jasmine/grunt/tasks/build_standalone.js:
--------------------------------------------------------------------------------
1 | var grunt = require("grunt");
2 |
3 | function standaloneTmpDir(path) { return "dist/tmp/" + path; }
4 |
5 | grunt.registerTask("build:compileSpecRunner",
6 | "Processes the spec runner template and writes to a tmp file",
7 | function() {
8 | var runnerHtml = grunt.template.process(
9 | grunt.file.read("grunt/templates/SpecRunner.html.jst"),
10 | { data: { jasmineVersion: global.jasmineVersion }});
11 |
12 | grunt.file.write(standaloneTmpDir("SpecRunner.html"), runnerHtml);
13 | }
14 | );
15 |
16 | grunt.registerTask("build:cleanSpecRunner",
17 | "Deletes the tmp spec runner file",
18 | function() {
19 | grunt.file.delete(standaloneTmpDir(""));
20 | }
21 | );
22 |
23 | grunt.registerTask("buildStandaloneDist",
24 | "Builds a standalone distribution",
25 | [
26 | "buildDistribution",
27 | "build:compileSpecRunner",
28 | "compress:standalone",
29 | "build:cleanSpecRunner"
30 | ]
31 | );
32 |
--------------------------------------------------------------------------------
/lib/jasmine/spec/core/matchers/toContainSpec.js:
--------------------------------------------------------------------------------
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 | });
27 |
--------------------------------------------------------------------------------
/lib/jasmine/spec/html/MatchersHtmlSpec.js:
--------------------------------------------------------------------------------
1 | describe("MatchersSpec - HTML Dependent", function () {
2 | var env, spec;
3 |
4 | beforeEach(function() {
5 | env = new j$.Env();
6 |
7 | var suite = env.describe("suite", function() {
8 | spec = env.it("spec", function() {
9 | });
10 | });
11 | spyOn(spec, 'addExpectationResult');
12 |
13 | addMatchers({
14 | toPass: function() {
15 | return lastResult().passed;
16 | },
17 | toFail: function() {
18 | return !lastResult().passed;
19 | }
20 | });
21 | });
22 |
23 | function match(value) {
24 | return spec.expect(value);
25 | }
26 |
27 | function lastResult() {
28 | return spec.addExpectationResult.mostRecentCall.args[1];
29 | }
30 |
31 | xit("toEqual with DOM nodes", function() {
32 | var nodeA = document.createElement('div');
33 | var nodeB = document.createElement('div');
34 | expect((match(nodeA).toEqual(nodeA))).toPass();
35 | expect((match(nodeA).toEqual(nodeB))).toFail();
36 | });
37 | });
38 |
--------------------------------------------------------------------------------
/lib/jasmine/src/core/Any.js:
--------------------------------------------------------------------------------
1 | getJasmineRequireObj().Any = function() {
2 |
3 | function Any(expectedObject) {
4 | this.expectedObject = expectedObject;
5 | }
6 |
7 | Any.prototype.jasmineMatches = function(other) {
8 | if (this.expectedObject == String) {
9 | return typeof other == 'string' || other instanceof String;
10 | }
11 |
12 | if (this.expectedObject == Number) {
13 | return typeof other == 'number' || other instanceof Number;
14 | }
15 |
16 | if (this.expectedObject == Function) {
17 | return typeof other == 'function' || other instanceof Function;
18 | }
19 |
20 | if (this.expectedObject == Object) {
21 | return typeof other == 'object';
22 | }
23 |
24 | if (this.expectedObject == Boolean) {
25 | return typeof other == 'boolean';
26 | }
27 |
28 | return other instanceof this.expectedObject;
29 | };
30 |
31 | Any.prototype.jasmineToString = function() {
32 | return '';
33 | };
34 |
35 | return Any;
36 | };
37 |
--------------------------------------------------------------------------------
/bower.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "bootstrap-tagsinput",
3 | "version": "0.5.0",
4 | "homepage": "https://github.com/TimSchlechter/bootstrap-tagsinput",
5 | "authors": [
6 | "Tim Schlechter",
7 | "Luckner Jr Jean-Baptiste"
8 | ],
9 | "description": "jQuery plugin providing a Twitter Bootstrap user interface for managing tags.",
10 | "main": [
11 | "dist/bootstrap-tagsinput.js",
12 | "dist/bootstrap-tagsinput.css"
13 | ],
14 | "keywords": [
15 | "tags",
16 | "bootstrap",
17 | "input",
18 | "select",
19 | "form"
20 | ],
21 | "license": "MIT",
22 | "ignore": [
23 | "**/.*",
24 | "node_modules",
25 | "bower_components",
26 | "lib",
27 | "test"
28 | ],
29 | "dependencies": {
30 | "jquery": "~2.1.1"
31 | },
32 | "devDependencies": {
33 | "bootstrap-3": "bootstrap#~3.2.0",
34 | "bootstrap-2.3.2": "bootstrap#~2.3.2",
35 | "angular": "~1.2.21",
36 | "typeahead.js": "~0.10.4",
37 | "jasmine": "~2.0.1"
38 | },
39 | "resolutions": {
40 | "jquery": ">= 1.9.0"
41 | }
42 | }
43 |
--------------------------------------------------------------------------------
/lib/jasmine/jasmine-core.gemspec:
--------------------------------------------------------------------------------
1 | # -*- encoding: utf-8 -*-
2 | $:.push File.expand_path("../lib", __FILE__)
3 | require "jasmine-core/version"
4 |
5 | Gem::Specification.new do |s|
6 | s.name = "jasmine-core"
7 | s.version = Jasmine::Core::VERSION
8 | s.platform = Gem::Platform::RUBY
9 | s.authors = ["Rajan Agaskar", "Davis W. Frank", "Christian Williams"]
10 | s.summary = %q{JavaScript BDD framework}
11 | s.description = %q{Test your JavaScript without any framework dependencies, in any environment, and with a nice descriptive syntax.}
12 | s.email = %q{jasmine-js@googlegroups.com}
13 | s.homepage = "http://pivotal.github.com/jasmine"
14 | s.rubyforge_project = "jasmine-core"
15 | s.license = "MIT"
16 |
17 | s.files = Dir.glob("./lib/**/*") + Dir.glob("./lib/jasmine-core/spec/**/*.js")
18 | s.require_paths = ["lib"]
19 | s.add_development_dependency "rake"
20 | s.add_development_dependency "sauce-connect"
21 | s.add_development_dependency "compass"
22 | s.add_development_dependency "jasmine_selenium_runner", ">= 0.2.0"
23 | end
24 |
--------------------------------------------------------------------------------
/lib/jasmine/spec/core/UtilSpec.js:
--------------------------------------------------------------------------------
1 | describe("j$.util", function() {
2 | describe("isArray_", function() {
3 | it("should return true if the argument is an array", function() {
4 | expect(j$.isArray_([])).toBe(true);
5 | expect(j$.isArray_(['a'])).toBe(true);
6 | });
7 |
8 | it("should return false if the argument is not an array", function() {
9 | expect(j$.isArray_(undefined)).toBe(false);
10 | expect(j$.isArray_({})).toBe(false);
11 | expect(j$.isArray_(function() {})).toBe(false);
12 | expect(j$.isArray_('foo')).toBe(false);
13 | expect(j$.isArray_(5)).toBe(false);
14 | expect(j$.isArray_(null)).toBe(false);
15 | });
16 | });
17 |
18 | describe("isUndefined", function() {
19 | it("reports if a variable is defined", function() {
20 | var a;
21 | expect(j$.util.isUndefined(a)).toBe(true);
22 | expect(j$.util.isUndefined(undefined)).toBe(true);
23 |
24 | var undefined = "diz be undefined yo";
25 | expect(j$.util.isUndefined(undefined)).toBe(false);
26 | });
27 | });
28 | });
29 |
--------------------------------------------------------------------------------
/lib/jasmine/spec/core/matchers/toMatchSpec.js:
--------------------------------------------------------------------------------
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 |
35 |
--------------------------------------------------------------------------------
/lib/jasmine/src/core/util.js:
--------------------------------------------------------------------------------
1 | getJasmineRequireObj().util = function() {
2 |
3 | var util = {};
4 |
5 | util.inherit = function(childClass, parentClass) {
6 | var Subclass = function() {
7 | };
8 | Subclass.prototype = parentClass.prototype;
9 | childClass.prototype = new Subclass();
10 | };
11 |
12 | util.htmlEscape = function(str) {
13 | if (!str) {
14 | return str;
15 | }
16 | return str.replace(/&/g, '&')
17 | .replace(//g, '>');
19 | };
20 |
21 | util.argsToArray = function(args) {
22 | var arrayOfArgs = [];
23 | for (var i = 0; i < args.length; i++) {
24 | arrayOfArgs.push(args[i]);
25 | }
26 | return arrayOfArgs;
27 | };
28 |
29 | util.isUndefined = function(obj) {
30 | return obj === void 0;
31 | };
32 |
33 | util.arrayContains = function(array, search) {
34 | var i = array.length;
35 | while (i--) {
36 | if (array[i] == search) {
37 | return true;
38 | }
39 | }
40 | return false;
41 | };
42 |
43 | return util;
44 | };
45 |
--------------------------------------------------------------------------------
/examples/assets/cities.json:
--------------------------------------------------------------------------------
1 | [ { "value": 1 , "text": "Amsterdam" , "continent": "Europe" },
2 | { "value": 2 , "text": "London" , "continent": "Europe" },
3 | { "value": 3 , "text": "Paris" , "continent": "Europe" },
4 | { "value": 4 , "text": "Washington" , "continent": "America" },
5 | { "value": 5 , "text": "Mexico City" , "continent": "America" },
6 | { "value": 6 , "text": "Buenos Aires", "continent": "America" },
7 | { "value": 7 , "text": "Sydney" , "continent": "Australia" },
8 | { "value": 8 , "text": "Wellington" , "continent": "Australia" },
9 | { "value": 9 , "text": "Canberra" , "continent": "Australia" },
10 | { "value": 10, "text": "Beijing" , "continent": "Asia" },
11 | { "value": 11, "text": "New Delhi" , "continent": "Asia" },
12 | { "value": 12, "text": "Kathmandu" , "continent": "Asia" },
13 | { "value": 13, "text": "Cairo" , "continent": "Africa" },
14 | { "value": 14, "text": "Cape Town" , "continent": "Africa" },
15 | { "value": 15, "text": "Kinshasa" , "continent": "Africa" }
16 | ]
--------------------------------------------------------------------------------
/lib/jasmine/spec/helpers/nodeDefineJasmineUnderTest.js:
--------------------------------------------------------------------------------
1 | (function() {
2 | var path = require("path"),
3 | fs = require("fs");
4 |
5 | var glob = require("glob");
6 |
7 | var j$Require = require(path.join(__dirname, "../../src/core/requireCore.js"));
8 |
9 | global.getJasmineRequireObj = function () {
10 | return j$Require;
11 | };
12 |
13 | function extend(destination, source) {
14 | for (var property in source) destination[property] = source[property];
15 | return destination;
16 | }
17 |
18 | function getSourceFiles() {
19 | var src_files = ['core/**/*.js', 'console/**/*.js', 'version.js'];
20 | src_files.forEach(function(file) {
21 | var filePath = path.join(__dirname, "../../", 'src/', file);
22 | glob.sync(filePath).forEach(function(resolvedFile) {
23 | require(resolvedFile);
24 | });
25 | });
26 | }
27 |
28 | extend(j$Require, require(path.join(__dirname,"../../src/console/requireConsole.js")));
29 | getSourceFiles();
30 | global.j$ = j$Require.core(j$Require);
31 |
32 | j$Require.console(j$Require, j$);
33 | })();
34 |
--------------------------------------------------------------------------------
/lib/jasmine/spec/core/matchers/toBeFalsySpec.js:
--------------------------------------------------------------------------------
1 | describe("toBeFalsy", function() {
2 | it("passes for 'falsy' values", function() {
3 | var matcher = j$.matchers.toBeFalsy(),
4 | result;
5 |
6 | result = matcher.compare(false);
7 | expect(result.pass).toBe(true);
8 |
9 | result = matcher.compare(0);
10 | expect(result.pass).toBe(true);
11 |
12 | result = matcher.compare('');
13 | expect(result.pass).toBe(true);
14 |
15 | result = matcher.compare(null);
16 | expect(result.pass).toBe(true);
17 |
18 | result = matcher.compare(void 0);
19 | expect(result.pass).toBe(true);
20 | });
21 |
22 | it("fails for 'truthy' values", function() {
23 | var matcher = j$.matchers.toBeFalsy(),
24 | result;
25 |
26 | result = matcher.compare(true);
27 | expect(result.pass).toBe(false);
28 |
29 | result = matcher.compare(1);
30 | expect(result.pass).toBe(false);
31 |
32 | result = matcher.compare("foo");
33 | expect(result.pass).toBe(false);
34 |
35 | result = matcher.compare({});
36 | expect(result.pass).toBe(false);
37 | });
38 | });
39 |
--------------------------------------------------------------------------------
/lib/jasmine/spec/core/matchers/toBeTruthySpec.js:
--------------------------------------------------------------------------------
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 | });
39 |
--------------------------------------------------------------------------------
/lib/jasmine/src/core/CallTracker.js:
--------------------------------------------------------------------------------
1 | getJasmineRequireObj().CallTracker = function() {
2 |
3 | function CallTracker() {
4 | var calls = [];
5 |
6 | this.track = function(context) {
7 | calls.push(context);
8 | };
9 |
10 | this.any = function() {
11 | return !!calls.length;
12 | };
13 |
14 | this.count = function() {
15 | return calls.length;
16 | };
17 |
18 | this.argsFor = function(index) {
19 | var call = calls[index];
20 | return call ? call.args : [];
21 | };
22 |
23 | this.all = function() {
24 | return calls;
25 | };
26 |
27 | this.allArgs = function() {
28 | var callArgs = [];
29 | for(var i = 0; i < calls.length; i++){
30 | callArgs.push(calls[i].args);
31 | }
32 |
33 | return callArgs;
34 | };
35 |
36 | this.first = function() {
37 | return calls[0];
38 | };
39 |
40 | this.mostRecent = function() {
41 | return calls[calls.length - 1];
42 | };
43 |
44 | this.reset = function() {
45 | calls = [];
46 | };
47 | }
48 |
49 | return CallTracker;
50 | };
51 |
--------------------------------------------------------------------------------
/lib/jasmine/MIT.LICENSE:
--------------------------------------------------------------------------------
1 | Copyright (c) 2008-2014 Pivotal Labs
2 |
3 | Permission is hereby granted, free of charge, to any person obtaining
4 | a copy of this software and associated documentation files (the
5 | "Software"), to deal in the Software without restriction, including
6 | without limitation the rights to use, copy, modify, merge, publish,
7 | distribute, sublicense, and/or sell copies of the Software, and to
8 | permit persons to whom the Software is furnished to do so, subject to
9 | the following conditions:
10 |
11 | The above copyright notice and this permission notice shall be
12 | included in all copies or substantial portions of the Software.
13 |
14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
21 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | The MIT License (MIT)
2 |
3 | Copyright (c) 2013 Tim Schlechter
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy of
6 | this software and associated documentation files (the "Software"), to deal in
7 | the Software without restriction, including without limitation the rights to
8 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
9 | the Software, and to permit persons to whom the Software is furnished to do so,
10 | subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
17 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
18 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
19 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
20 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
21 |
--------------------------------------------------------------------------------
/lib/jasmine/grunt/templates/SpecRunner.html.jst:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Jasmine Spec Runner v<%= jasmineVersion %>
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/lib/jasmine/spec/core/matchers/toBeNaNSpec.js:
--------------------------------------------------------------------------------
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 | });
38 |
--------------------------------------------------------------------------------
/lib/jasmine/grunt/templates/licenseBanner.js.jst:
--------------------------------------------------------------------------------
1 | /*
2 | Copyright (c) 2008-<%= currentYear %> Pivotal Labs
3 |
4 | Permission is hereby granted, free of charge, to any person obtaining
5 | a copy of this software and associated documentation files (the
6 | "Software"), to deal in the Software without restriction, including
7 | without limitation the rights to use, copy, modify, merge, publish,
8 | distribute, sublicense, and/or sell copies of the Software, and to
9 | permit persons to whom the Software is furnished to do so, subject to
10 | the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be
13 | included in all copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
16 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
17 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
18 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
19 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
20 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
21 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22 | */
23 |
--------------------------------------------------------------------------------
/dist/bootstrap-tagsinput.less:
--------------------------------------------------------------------------------
1 | .bootstrap-tagsinput {
2 | background-color: #fff;
3 | border: 1px solid #ccc;
4 | box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
5 | display: inline-block;
6 | padding: 4px 6px;
7 | margin-bottom: 10px;
8 | color: #555;
9 | vertical-align: middle;
10 | border-radius: 4px;
11 | max-width: 100%;
12 | line-height: 22px;
13 | cursor: text;
14 |
15 | input {
16 | border: none;
17 | box-shadow: none;
18 | outline: none;
19 | background-color: transparent;
20 | padding: 0;
21 | margin: 0;
22 | width: auto !important;
23 | max-width: inherit;
24 |
25 | &:focus {
26 | border: none;
27 | box-shadow: none;
28 | }
29 | }
30 |
31 | .tag {
32 | margin-right: 2px;
33 | color: white;
34 |
35 | [data-role="remove"] {
36 | margin-left:8px;
37 | cursor:pointer;
38 | &:after{
39 | content: "x";
40 | padding:0px 2px;
41 | }
42 | &:hover {
43 | box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05);
44 | &:active {
45 | box-shadow: inset 0 3px 5px rgba(0,0,0,0.125);
46 | }
47 | }
48 | }
49 | }
50 | }
51 |
--------------------------------------------------------------------------------
/src/bootstrap-tagsinput-typeahead.css:
--------------------------------------------------------------------------------
1 | .twitter-typeahead .tt-query,
2 | .twitter-typeahead .tt-hint {
3 | margin-bottom: 0;
4 | }
5 |
6 | .twitter-typeahead .tt-hint
7 | {
8 | display: none;
9 | }
10 |
11 | .tt-menu {
12 | position: absolute;
13 | top: 100%;
14 | left: 0;
15 | z-index: 1000;
16 | display: none;
17 | float: left;
18 | min-width: 160px;
19 | padding: 5px 0;
20 | margin: 2px 0 0;
21 | list-style: none;
22 | font-size: 14px;
23 | background-color: #ffffff;
24 | border: 1px solid #cccccc;
25 | border: 1px solid rgba(0, 0, 0, 0.15);
26 | border-radius: 4px;
27 | -webkit-box-shadow: 0 6px 12px rgba(0, 0, 0, 0.175);
28 | box-shadow: 0 6px 12px rgba(0, 0, 0, 0.175);
29 | background-clip: padding-box;
30 | cursor: pointer;
31 | }
32 |
33 | .tt-suggestion {
34 | display: block;
35 | padding: 3px 20px;
36 | clear: both;
37 | font-weight: normal;
38 | line-height: 1.428571429;
39 | color: #333333;
40 | white-space: nowrap;
41 | }
42 |
43 | .tt-suggestion:hover,
44 | .tt-suggestion:focus {
45 | color: #ffffff;
46 | text-decoration: none;
47 | outline: 0;
48 | background-color: #428bca;
49 | }
50 |
--------------------------------------------------------------------------------
/lib/jasmine/lib/jasmine-core.js:
--------------------------------------------------------------------------------
1 | module.exports = require("./jasmine-core/jasmine.js");
2 | module.exports.boot = require('./jasmine-core/node_boot.js');
3 |
4 | module.exports.files = (function() {
5 | var path = require('path'),
6 | fs = require('fs');
7 |
8 | var rootPath = path.join(__dirname, "jasmine-core"),
9 | bootFiles = ['boot.js'],
10 | nodeBootFiles = ['node_boot.js'],
11 | cssFiles = [],
12 | jsFiles = [],
13 | jsFilesToSkip = ['jasmine.js'].concat(bootFiles, nodeBootFiles);
14 |
15 | fs.readdirSync(rootPath).forEach(function(file) {
16 | if(fs.statSync(path.join(rootPath, file)).isFile()) {
17 | switch(path.extname(file)) {
18 | case '.css':
19 | cssFiles.push(file);
20 | break;
21 | case '.js':
22 | if (jsFilesToSkip.indexOf(file) < 0) {
23 | jsFiles.push(file);
24 | }
25 | break;
26 | }
27 | }
28 | });
29 |
30 | return {
31 | path: rootPath,
32 | bootDir: rootPath,
33 | bootFiles: bootFiles,
34 | nodeBootFiles: nodeBootFiles,
35 | cssFiles: cssFiles,
36 | jsFiles: ['jasmine.js'].concat(jsFiles),
37 | imagesDir: path.join(__dirname, '../images')
38 | };
39 | }());
40 |
--------------------------------------------------------------------------------
/dist/bootstrap-tagsinput-typeahead.css:
--------------------------------------------------------------------------------
1 | /*
2 | * bootstrap-tagsinput v0.8.0
3 | *
4 | */
5 |
6 | .twitter-typeahead .tt-query,
7 | .twitter-typeahead .tt-hint {
8 | margin-bottom: 0;
9 | }
10 |
11 | .twitter-typeahead .tt-hint
12 | {
13 | display: none;
14 | }
15 |
16 | .tt-menu {
17 | position: absolute;
18 | top: 100%;
19 | left: 0;
20 | z-index: 1000;
21 | display: none;
22 | float: left;
23 | min-width: 160px;
24 | padding: 5px 0;
25 | margin: 2px 0 0;
26 | list-style: none;
27 | font-size: 14px;
28 | background-color: #ffffff;
29 | border: 1px solid #cccccc;
30 | border: 1px solid rgba(0, 0, 0, 0.15);
31 | border-radius: 4px;
32 | -webkit-box-shadow: 0 6px 12px rgba(0, 0, 0, 0.175);
33 | box-shadow: 0 6px 12px rgba(0, 0, 0, 0.175);
34 | background-clip: padding-box;
35 | cursor: pointer;
36 | }
37 |
38 | .tt-suggestion {
39 | display: block;
40 | padding: 3px 20px;
41 | clear: both;
42 | font-weight: normal;
43 | line-height: 1.428571429;
44 | color: #333333;
45 | white-space: nowrap;
46 | }
47 |
48 | .tt-suggestion:hover,
49 | .tt-suggestion:focus {
50 | color: #ffffff;
51 | text-decoration: none;
52 | outline: 0;
53 | background-color: #428bca;
54 | }
55 |
--------------------------------------------------------------------------------
/lib/jasmine/spec/core/AnySpec.js:
--------------------------------------------------------------------------------
1 | describe("Any", function() {
2 | it("matches a string", function() {
3 | var any = new j$.Any(String);
4 |
5 | expect(any.jasmineMatches("foo")).toBe(true);
6 | });
7 |
8 | it("matches a number", function() {
9 | var any = new j$.Any(Number);
10 |
11 | expect(any.jasmineMatches(1)).toBe(true);
12 | });
13 |
14 | it("matches a function", function() {
15 | var any = new j$.Any(Function);
16 |
17 | expect(any.jasmineMatches(function(){})).toBe(true);
18 | });
19 |
20 | it("matches an Object", function() {
21 | var any = new j$.Any(Object);
22 |
23 | expect(any.jasmineMatches({})).toBe(true);
24 | });
25 |
26 | it("matches a Boolean", function() {
27 | var any = new j$.Any(Boolean);
28 |
29 | expect(any.jasmineMatches(true)).toBe(true);
30 | });
31 |
32 | it("matches another constructed object", function() {
33 | var Thing = function() {},
34 | any = new j$.Any(Thing);
35 |
36 | expect(any.jasmineMatches(new Thing())).toBe(true);
37 | });
38 |
39 | it("jasmineToString's itself", function() {
40 | var any = new j$.Any(Number);
41 |
42 | expect(any.jasmineToString()).toMatch('').appendTo($('body'));
13 | this.$element = $(elementHtml).appendTo(this.$sandbox);
14 | this.$element.tagsinput(options);
15 | this.$tagsinput = $('.bootstrap-tagsinput', this.$sandbox);
16 | this.$tagsinput_input = $('input', this.$tagsinput);
17 | });
18 |
19 | afterEach(function() {
20 |
21 | this.$element.tagsinput('destroy');
22 | this.$sandbox.remove();
23 |
24 | delete this.$tagsinput_input;
25 | delete this.$tagsinput;
26 | delete this.$sandbox;
27 | delete this.$element;
28 | });
29 |
30 | tests();
31 | });
32 | }
33 |
34 | function hasFocus($elt) {
35 | return $elt.get(0) === document.activeElement;
36 | }
--------------------------------------------------------------------------------
/lib/jasmine/src/core/SpyStrategy.js:
--------------------------------------------------------------------------------
1 | getJasmineRequireObj().SpyStrategy = function() {
2 |
3 | function SpyStrategy(options) {
4 | options = options || {};
5 |
6 | var identity = options.name || 'unknown',
7 | originalFn = options.fn || function() {},
8 | getSpy = options.getSpy || function() {},
9 | plan = function() {};
10 |
11 | this.identity = function() {
12 | return identity;
13 | };
14 |
15 | this.exec = function() {
16 | return plan.apply(this, arguments);
17 | };
18 |
19 | this.callThrough = function() {
20 | plan = originalFn;
21 | return getSpy();
22 | };
23 |
24 | this.returnValue = function(value) {
25 | plan = function() {
26 | return value;
27 | };
28 | return getSpy();
29 | };
30 |
31 | this.throwError = function(something) {
32 | var error = (something instanceof Error) ? something : new Error(something);
33 | plan = function() {
34 | throw error;
35 | };
36 | return getSpy();
37 | };
38 |
39 | this.callFake = function(fn) {
40 | plan = fn;
41 | return getSpy();
42 | };
43 |
44 | this.stub = function(fn) {
45 | plan = function() {};
46 | return getSpy();
47 | };
48 | }
49 |
50 | return SpyStrategy;
51 | };
52 |
--------------------------------------------------------------------------------
/lib/jasmine/src/core/ExpectationResult.js:
--------------------------------------------------------------------------------
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 | };
46 |
--------------------------------------------------------------------------------
/lib/bootstrap-3/bootstrap.less:
--------------------------------------------------------------------------------
1 | // Core variables and mixins
2 | @import "variables.less";
3 | @import "mixins.less";
4 |
5 | // Reset and dependencies
6 | @import "normalize.less";
7 | @import "print.less";
8 | @import "glyphicons.less";
9 |
10 | // Core CSS
11 | @import "scaffolding.less";
12 | @import "type.less";
13 | @import "code.less";
14 | @import "grid.less";
15 | @import "tables.less";
16 | @import "forms.less";
17 | @import "buttons.less";
18 |
19 | // Components
20 | @import "component-animations.less";
21 | @import "dropdowns.less";
22 | @import "button-groups.less";
23 | @import "input-groups.less";
24 | @import "navs.less";
25 | @import "navbar.less";
26 | @import "breadcrumbs.less";
27 | @import "pagination.less";
28 | @import "pager.less";
29 | @import "labels.less";
30 | @import "badges.less";
31 | @import "jumbotron.less";
32 | @import "thumbnails.less";
33 | @import "alerts.less";
34 | @import "progress-bars.less";
35 | @import "media.less";
36 | @import "list-group.less";
37 | @import "panels.less";
38 | @import "responsive-embed.less";
39 | @import "wells.less";
40 | @import "close.less";
41 |
42 | // Components w/ JavaScript
43 | @import "modals.less";
44 | @import "tooltip.less";
45 | @import "popovers.less";
46 | @import "carousel.less";
47 |
48 | // Utility classes
49 | @import "utilities.less";
50 | @import "responsive-utilities.less";
51 |
--------------------------------------------------------------------------------
/lib/jasmine/spec/html/QueryStringSpec.js:
--------------------------------------------------------------------------------
1 | describe("QueryString", function() {
2 |
3 | describe("#setParam", function() {
4 |
5 | it("sets the query string to include the given key/value pair", function() {
6 | var windowLocation = {
7 | search: ""
8 | },
9 | queryString = new j$.QueryString({
10 | getWindowLocation: function() { return windowLocation }
11 | });
12 |
13 | queryString.setParam("foo", "bar baz");
14 |
15 | expect(windowLocation.search).toMatch(/foo=bar%20baz/);
16 | });
17 | });
18 |
19 | describe("#getParam", function() {
20 |
21 | it("returns the value of the requested key", function() {
22 | var windowLocation = {
23 | search: "?baz=quux%20corge"
24 | },
25 | queryString = new j$.QueryString({
26 | getWindowLocation: function() { return windowLocation }
27 | });
28 |
29 | expect(queryString.getParam("baz")).toEqual("quux corge");
30 | });
31 |
32 | it("returns null if the key is not present", function() {
33 | var windowLocation = {
34 | search: ""
35 | },
36 | queryString = new j$.QueryString({
37 | getWindowLocation: function() { return windowLocation }
38 | });
39 |
40 | expect(queryString.getParam("baz")).toBeFalsy();
41 | });
42 | });
43 | });
44 |
--------------------------------------------------------------------------------
/lib/jasmine/lib/jasmine-core.rb:
--------------------------------------------------------------------------------
1 | module Jasmine
2 | module Core
3 | class << self
4 | def path
5 | File.join(File.dirname(__FILE__), "jasmine-core")
6 | end
7 |
8 | def js_files
9 | (["jasmine.js"] + Dir.glob(File.join(path, "*.js"))).map { |f| File.basename(f) }.uniq - boot_files - node_boot_files
10 | end
11 |
12 | SPEC_TYPES = ["core", "html", "node"]
13 |
14 | def core_spec_files
15 | spec_files("core")
16 | end
17 |
18 | def html_spec_files
19 | spec_files("html")
20 | end
21 |
22 | def node_spec_files
23 | spec_files("node")
24 | end
25 |
26 | def boot_files
27 | ["boot.js"]
28 | end
29 |
30 | def node_boot_files
31 | ["node_boot.js"]
32 | end
33 |
34 | def boot_dir
35 | path
36 | end
37 |
38 | def spec_files(type)
39 | raise ArgumentError.new("Unrecognized spec type") unless SPEC_TYPES.include?(type)
40 | (Dir.glob(File.join(path, "spec", type, "*.js"))).map { |f| File.join("spec", type, File.basename(f)) }.uniq
41 | end
42 |
43 | def css_files
44 | Dir.glob(File.join(path, "*.css")).map { |f| File.basename(f) }
45 | end
46 |
47 | def images_dir
48 | File.join(File.dirname(__FILE__), '../images')
49 | end
50 |
51 | end
52 | end
53 | end
54 |
--------------------------------------------------------------------------------
/lib/jasmine/src/core/matchers/toThrow.js:
--------------------------------------------------------------------------------
1 | getJasmineRequireObj().toThrow = function(j$) {
2 |
3 | function toThrow(util) {
4 | return {
5 | compare: function(actual, expected) {
6 | var result = { pass: false },
7 | threw = false,
8 | thrown;
9 |
10 | if (typeof actual != 'function') {
11 | throw new Error('Actual is not a Function');
12 | }
13 |
14 | try {
15 | actual();
16 | } catch (e) {
17 | threw = true;
18 | thrown = e;
19 | }
20 |
21 | if (!threw) {
22 | result.message = 'Expected function to throw an exception.';
23 | return result;
24 | }
25 |
26 | if (arguments.length == 1) {
27 | result.pass = true;
28 | result.message = function() { return 'Expected function not to throw, but it threw ' + j$.pp(thrown) + '.'; };
29 |
30 | return result;
31 | }
32 |
33 | if (util.equals(thrown, expected)) {
34 | result.pass = true;
35 | result.message = function() { return 'Expected function not to throw ' + j$.pp(expected) + '.'; };
36 | } else {
37 | result.message = function() { return 'Expected function to throw ' + j$.pp(expected) + ', but it threw ' + j$.pp(thrown) + '.'; };
38 | }
39 |
40 | return result;
41 | }
42 | };
43 | }
44 |
45 | return toThrow;
46 | };
47 |
--------------------------------------------------------------------------------
/lib/jasmine/src/core/requireCore.js:
--------------------------------------------------------------------------------
1 | function getJasmineRequireObj() {
2 | if (typeof module !== 'undefined' && module.exports) {
3 | return exports;
4 | } else {
5 | window.jasmineRequire = window.jasmineRequire || {};
6 | return window.jasmineRequire;
7 | }
8 | }
9 |
10 | getJasmineRequireObj().core = function(jRequire) {
11 | var j$ = {};
12 |
13 | jRequire.base(j$);
14 | j$.util = jRequire.util();
15 | j$.Any = jRequire.Any();
16 | j$.CallTracker = jRequire.CallTracker();
17 | j$.MockDate = jRequire.MockDate();
18 | j$.Clock = jRequire.Clock();
19 | j$.DelayedFunctionScheduler = jRequire.DelayedFunctionScheduler();
20 | j$.Env = jRequire.Env(j$);
21 | j$.ExceptionFormatter = jRequire.ExceptionFormatter();
22 | j$.Expectation = jRequire.Expectation();
23 | j$.buildExpectationResult = jRequire.buildExpectationResult();
24 | j$.JsApiReporter = jRequire.JsApiReporter();
25 | j$.matchersUtil = jRequire.matchersUtil(j$);
26 | j$.ObjectContaining = jRequire.ObjectContaining(j$);
27 | j$.pp = jRequire.pp(j$);
28 | j$.QueueRunner = jRequire.QueueRunner(j$);
29 | j$.ReportDispatcher = jRequire.ReportDispatcher();
30 | j$.Spec = jRequire.Spec(j$);
31 | j$.SpyStrategy = jRequire.SpyStrategy();
32 | j$.Suite = jRequire.Suite();
33 | j$.Timer = jRequire.Timer();
34 | j$.version = jRequire.version();
35 |
36 | j$.matchers = jRequire.requireMatchers(jRequire, j$);
37 |
38 | return j$;
39 | };
40 |
--------------------------------------------------------------------------------
/lib/jasmine/src/html/QueryString.js:
--------------------------------------------------------------------------------
1 | jasmineRequire.QueryString = function() {
2 | function QueryString(options) {
3 |
4 | this.setParam = function(key, value) {
5 | var paramMap = queryStringToParamMap();
6 | paramMap[key] = value;
7 | options.getWindowLocation().search = toQueryString(paramMap);
8 | };
9 |
10 | this.getParam = function(key) {
11 | return queryStringToParamMap()[key];
12 | };
13 |
14 | return this;
15 |
16 | function toQueryString(paramMap) {
17 | var qStrPairs = [];
18 | for (var prop in paramMap) {
19 | qStrPairs.push(encodeURIComponent(prop) + '=' + encodeURIComponent(paramMap[prop]));
20 | }
21 | return '?' + qStrPairs.join('&');
22 | }
23 |
24 | function queryStringToParamMap() {
25 | var paramStr = options.getWindowLocation().search.substring(1),
26 | params = [],
27 | paramMap = {};
28 |
29 | if (paramStr.length > 0) {
30 | params = paramStr.split('&');
31 | for (var i = 0; i < params.length; i++) {
32 | var p = params[i].split('=');
33 | var value = decodeURIComponent(p[1]);
34 | if (value === 'true' || value === 'false') {
35 | value = JSON.parse(value);
36 | }
37 | paramMap[decodeURIComponent(p[0])] = value;
38 | }
39 | }
40 |
41 | return paramMap;
42 | }
43 |
44 | }
45 |
46 | return QueryString;
47 | };
48 |
--------------------------------------------------------------------------------
/dist/bootstrap-tagsinput-angular.min.js:
--------------------------------------------------------------------------------
1 | /*
2 | * bootstrap-tagsinput v0.8.0
3 | *
4 | */
5 |
6 | angular.module("bootstrap-tagsinput",[]).directive("bootstrapTagsinput",[function(){function a(a,b){if(b)return angular.isFunction(a.$parent[b])?a.$parent[b]:function(a){return a[b]}}return{restrict:"EA",scope:{model:"=ngModel"},template:"",replace:!1,link:function(b,c,d){$(function(){angular.isArray(b.model)||(b.model=[]);var e=$("select",c),f=d.typeaheadSource?d.typeaheadSource.split("."):null,g=f?f.length>1?b.$parent[f[0]][f[1]]:b.$parent[f[0]]:null;e.tagsinput(b.$parent[d.options||""]||{typeahead:{source:angular.isFunction(g)?g:null},itemValue:a(b,d.itemvalue),itemText:a(b,d.itemtext),confirmKeys:a(b,d.confirmkeys)?JSON.parse(d.confirmkeys):[13],tagClass:angular.isFunction(b.$parent[d.tagclass])?b.$parent[d.tagclass]:function(a){return d.tagclass}});for(var h=0;h';
31 | };
32 |
33 | return ObjectContaining;
34 | };
35 |
--------------------------------------------------------------------------------
/src/bootstrap-tagsinput.css:
--------------------------------------------------------------------------------
1 | .bootstrap-tagsinput {
2 | background-color: #fff;
3 | border: 1px solid #ccc;
4 | box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
5 | display: inline-block;
6 | padding: 4px 6px;
7 | color: #555;
8 | vertical-align: middle;
9 | border-radius: 4px;
10 | max-width: 100%;
11 | line-height: 22px;
12 | cursor: text;
13 | }
14 | .bootstrap-tagsinput input {
15 | border: none;
16 | box-shadow: none;
17 | outline: none;
18 | background-color: transparent;
19 | padding: 0 6px;
20 | margin: 0;
21 | width: auto;
22 | max-width: inherit;
23 | }
24 | .bootstrap-tagsinput.form-control input::-moz-placeholder {
25 | color: #777;
26 | opacity: 1;
27 | }
28 | .bootstrap-tagsinput.form-control input:-ms-input-placeholder {
29 | color: #777;
30 | }
31 | .bootstrap-tagsinput.form-control input::-webkit-input-placeholder {
32 | color: #777;
33 | }
34 | .bootstrap-tagsinput input:focus {
35 | border: none;
36 | box-shadow: none;
37 | }
38 | .bootstrap-tagsinput .tag {
39 | margin-right: 2px;
40 | color: white;
41 | }
42 | .bootstrap-tagsinput .tag [data-role="remove"] {
43 | margin-left: 8px;
44 | cursor: pointer;
45 | }
46 | .bootstrap-tagsinput .tag [data-role="remove"]:after {
47 | content: "x";
48 | padding: 0px 2px;
49 | }
50 | .bootstrap-tagsinput .tag [data-role="remove"]:hover {
51 | box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05);
52 | }
53 | .bootstrap-tagsinput .tag [data-role="remove"]:hover:active {
54 | box-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125);
55 | }
56 |
--------------------------------------------------------------------------------
/lib/jasmine/src/core/requireInterface.js:
--------------------------------------------------------------------------------
1 | getJasmineRequireObj().interface = function(jasmine, env) {
2 | var jasmineInterface = {
3 | describe: function(description, specDefinitions) {
4 | return env.describe(description, specDefinitions);
5 | },
6 |
7 | xdescribe: function(description, specDefinitions) {
8 | return env.xdescribe(description, specDefinitions);
9 | },
10 |
11 | it: function(desc, func) {
12 | return env.it(desc, func);
13 | },
14 |
15 | xit: function(desc, func) {
16 | return env.xit(desc, func);
17 | },
18 |
19 | beforeEach: function(beforeEachFunction) {
20 | return env.beforeEach(beforeEachFunction);
21 | },
22 |
23 | afterEach: function(afterEachFunction) {
24 | return env.afterEach(afterEachFunction);
25 | },
26 |
27 | expect: function(actual) {
28 | return env.expect(actual);
29 | },
30 |
31 | pending: function() {
32 | return env.pending();
33 | },
34 |
35 | spyOn: function(obj, methodName) {
36 | return env.spyOn(obj, methodName);
37 | },
38 |
39 | jsApiReporter: new jasmine.JsApiReporter({
40 | timer: new jasmine.Timer()
41 | }),
42 |
43 | jasmine: jasmine
44 | };
45 |
46 | jasmine.addCustomEqualityTester = function(tester) {
47 | env.addCustomEqualityTester(tester);
48 | };
49 |
50 | jasmine.addMatchers = function(matchers) {
51 | return env.addMatchers(matchers);
52 | };
53 |
54 | jasmine.clock = function() {
55 | return env.clock;
56 | };
57 |
58 | return jasmineInterface;
59 | };
60 |
--------------------------------------------------------------------------------
/lib/jasmine/spec/core/matchers/toBeCloseToSpec.js:
--------------------------------------------------------------------------------
1 | describe("toBeCloseTo", function() {
2 | it("passes when within two decimal places by default", function() {
3 | var matcher = j$.matchers.toBeCloseTo(),
4 | result;
5 |
6 | result = matcher.compare(0, 0);
7 | expect(result.pass).toBe(true);
8 |
9 | result = matcher.compare(0, 0.001);
10 | expect(result.pass).toBe(true);
11 | });
12 |
13 | it("fails when not within two decimal places by default", function() {
14 | var matcher = j$.matchers.toBeCloseTo(),
15 | result;
16 |
17 | result = matcher.compare(0, 0.01);
18 | expect(result.pass).toBe(false);
19 | });
20 |
21 | it("accepts an optional precision argument", function() {
22 | var matcher = j$.matchers.toBeCloseTo(),
23 | result;
24 |
25 | result = matcher.compare(0, 0.1, 0);
26 | expect(result.pass).toBe(true);
27 |
28 | result = matcher.compare(0, 0.0001, 3);
29 | expect(result.pass).toBe(true);
30 | });
31 |
32 | it("rounds expected values", function() {
33 | var matcher = j$.matchers.toBeCloseTo(),
34 | result;
35 |
36 | result = matcher.compare(1.23, 1.229);
37 | expect(result.pass).toBe(true);
38 |
39 | result = matcher.compare(1.23, 1.226);
40 | expect(result.pass).toBe(true);
41 |
42 | result = matcher.compare(1.23, 1.225);
43 | expect(result.pass).toBe(true);
44 |
45 | result = matcher.compare(1.23, 1.2249999);
46 | expect(result.pass).toBe(false);
47 |
48 | result = matcher.compare(1.23, 1.234);
49 | expect(result.pass).toBe(true);
50 | });
51 | });
52 |
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "bootstrap-tagsinput",
3 | "title": "Bootstrap Tags Input",
4 | "version": "0.8.0",
5 | "description": "jQuery plugin providing a Twitter Bootstrap user interface for managing tags.",
6 | "scripts": {
7 | "test": "karma start --single-run --no-auto-watch"
8 | },
9 | "main": "dist/bootstrap-tagsinput.js",
10 | "repository": {
11 | "type": "git",
12 | "url": "git://github.com/timschlechter/bootstrap-tagsinput.git"
13 | },
14 | "author": "Tim Schlechter",
15 | "contributors": [
16 | {
17 | "name": "Luckner Jr Jean-Baptiste"
18 | }
19 | ],
20 | "license": "MIT",
21 | "homepage": "http://timschlechter.github.io/bootstrap-tagsinput/examples/",
22 | "download": "http://timschlechter.github.io/bootstrap-tagsinput/build/bootstrap-tagsinput.zip",
23 | "keywords": [
24 | "tags",
25 | "bootstrap",
26 | "input",
27 | "select",
28 | "form"
29 | ],
30 | "readmeFilename": "README.md",
31 | "devDependencies": {
32 | "bower": "~1.3.8",
33 | "grunt": "~0.4.1",
34 | "grunt-banner": "^0.6.0",
35 | "grunt-bower-task": "~0.4.0",
36 | "grunt-cli": "~0.1.13",
37 | "grunt-contrib-copy": "~0.5.0",
38 | "grunt-contrib-uglify": "^0.9.1",
39 | "grunt-jquerymanifest": "~0.1.4",
40 | "grunt-karma": "^0.12.1",
41 | "grunt-zip": "~0.15.0",
42 | "karma": "~0.13.0",
43 | "karma-jasmine": "~0.1.5",
44 | "karma-phantomjs-launcher": "~0.1.3",
45 | "phantomjs": "~1.9.7-15"
46 | },
47 | "banner": "/*\n * <%= pkg.name %> v<%= pkg.version %>\n * <%= pkg.license.url %>\n */\n"
48 | }
49 |
--------------------------------------------------------------------------------
/test/bootstrap-tagsinput/select_with_object_items.tests.js:
--------------------------------------------------------------------------------
1 | describe("bootstrap-tagsinput", function() {
2 |
3 | describe("with objects as items", function() {
4 |
5 | testTagsInput('', { itemValue: function(item) { return item.value; }, itemText: function(item) { return item.text; } }, function() {
6 | describe("adding an item", function() {
7 | var item;
8 | beforeEach(function() {
9 | item = { value: 1, text: 'some' };
10 | this.$element.tagsinput('add', item);
11 | });
12 | it("'items' should return the item", function() {
13 | expect(this.$element.tagsinput('items')[0]).toBe(item);
14 | });
15 | it("val() should return the item's value", function() {
16 | expect(this.$element.val()[0]).toBe("1");
17 | });
18 | it("tag's text should be the item's text", function() {
19 | expect($('.tag', this.$sandbox).text()).toBe("some");
20 | });
21 |
22 | describe("change item's value and text and invoke 'refesh'", function() {
23 | beforeEach(function() {
24 | item.value = 2;
25 | item.text = 'changed';
26 | this.$element.tagsinput('refresh');
27 | });
28 |
29 | it("should update tags's text", function() {
30 | expect($('.tag', this.$sandbox).text()).toBe('changed');
31 | });
32 | it("val() should return item's new value", function() {
33 | expect(this.$element.val()[0]).toBe("2");
34 | });
35 | });
36 | });
37 | });
38 | });
39 | });
--------------------------------------------------------------------------------
/dist/bootstrap-tagsinput.css:
--------------------------------------------------------------------------------
1 | /*
2 | * bootstrap-tagsinput v0.8.0
3 | *
4 | */
5 |
6 | .bootstrap-tagsinput {
7 | background-color: #fff;
8 | border: 1px solid #ccc;
9 | box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
10 | display: inline-block;
11 | padding: 4px 6px;
12 | color: #555;
13 | vertical-align: middle;
14 | border-radius: 4px;
15 | max-width: 100%;
16 | line-height: 22px;
17 | cursor: text;
18 | }
19 | .bootstrap-tagsinput input {
20 | border: none;
21 | box-shadow: none;
22 | outline: none;
23 | background-color: transparent;
24 | padding: 0 6px;
25 | margin: 0;
26 | width: auto;
27 | max-width: inherit;
28 | }
29 | .bootstrap-tagsinput.form-control input::-moz-placeholder {
30 | color: #777;
31 | opacity: 1;
32 | }
33 | .bootstrap-tagsinput.form-control input:-ms-input-placeholder {
34 | color: #777;
35 | }
36 | .bootstrap-tagsinput.form-control input::-webkit-input-placeholder {
37 | color: #777;
38 | }
39 | .bootstrap-tagsinput input:focus {
40 | border: none;
41 | box-shadow: none;
42 | }
43 | .bootstrap-tagsinput .tag {
44 | margin-right: 2px;
45 | color: white;
46 | }
47 | .bootstrap-tagsinput .tag [data-role="remove"] {
48 | margin-left: 8px;
49 | cursor: pointer;
50 | }
51 | .bootstrap-tagsinput .tag [data-role="remove"]:after {
52 | content: "x";
53 | padding: 0px 2px;
54 | }
55 | .bootstrap-tagsinput .tag [data-role="remove"]:hover {
56 | box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05);
57 | }
58 | .bootstrap-tagsinput .tag [data-role="remove"]:hover:active {
59 | box-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125);
60 | }
61 |
--------------------------------------------------------------------------------
/lib/jasmine/grunt/config/concat.js:
--------------------------------------------------------------------------------
1 | var grunt = require('grunt');
2 |
3 | function license() {
4 | var currentYear = "" + new Date(Date.now()).getFullYear();
5 |
6 | return grunt.template.process(
7 | grunt.file.read("grunt/templates/licenseBanner.js.jst"),
8 | { data: { currentYear: currentYear}});
9 | }
10 |
11 | module.exports = {
12 | 'jasmine-html': {
13 | src: [
14 | 'src/html/requireHtml.js',
15 | 'src/html/HtmlReporter.js',
16 | 'src/html/HtmlSpecFilter.js',
17 | 'src/html/ResultsNode.js',
18 | 'src/html/QueryString.js'
19 | ],
20 | dest: 'lib/jasmine-core/jasmine-html.js'
21 | },
22 | jasmine: {
23 | src: [
24 | 'src/core/requireCore.js',
25 | 'src/core/matchers/requireMatchers.js',
26 | 'src/core/base.js',
27 | 'src/core/util.js',
28 | 'src/core/Spec.js',
29 | 'src/core/Env.js',
30 | 'src/core/JsApiReporter.js',
31 | 'src/core/PrettyPrinter',
32 | 'src/core/Suite',
33 | 'src/core/**/*.js',
34 | 'src/version.js'
35 | ],
36 | dest: 'lib/jasmine-core/jasmine.js'
37 | },
38 | boot: {
39 | src: ['lib/jasmine-core/boot/boot.js'],
40 | dest: 'lib/jasmine-core/boot.js'
41 | },
42 | nodeBoot: {
43 | src: ['lib/jasmine-core/boot/node_boot.js'],
44 | dest: 'lib/jasmine-core/node_boot.js'
45 | },
46 | console: {
47 | src: [
48 | 'src/console/requireConsole.js',
49 | 'src/console/ConsoleReporter.js'
50 | ],
51 | dest: 'lib/console/console.js'
52 | },
53 | options: {
54 | banner: license(),
55 | process: {
56 | data: {
57 | version: global.jasmineVersion
58 | }
59 | }
60 | }
61 | };
62 |
--------------------------------------------------------------------------------
/test/bootstrap-tagsinput/select_with_string_items.tests.js:
--------------------------------------------------------------------------------
1 | describe("bootstrap-tagsinput", function() {
2 |
3 | describe("with strings as items", function() {
4 |
5 | testTagsInput("", function() {
6 |
7 | describe("when added 1 item", function() {
8 | beforeEach(function() {
9 | this.$element.tagsinput('add', 'some_tag');
10 | });
11 |
12 | it("val() should return array containing 1 item", function() {
13 | expect(this.$element.val()[0]).toBe('some_tag');
14 | });
15 |
16 | describe("invoking 'remove'", function() {
17 | beforeEach(function() {
18 | this.$element.tagsinput('remove', 'some_tag');
19 | });
20 |
21 | it("val() should should return null", function() {
22 | expect(this.$element.val()).toBeNull();
23 | });
24 |
25 | it("there should be no elements", function() {
26 | expect($("option", this.$sandbox).length).toBe(0);
27 | });
28 | });
29 | });
30 |
31 | describe("when added item containing a comma", function() {
32 | beforeEach(function() {
33 | this.$element.tagsinput('add', 'before,after');
34 | });
35 |
36 | it("val() should return array containing 1 item", function() {
37 | expect(this.$element.val()[0]).toBe('before,after');
38 | });
39 | });
40 | });
41 |
42 | testTagsInput('', function() {
43 | it('should have one tag', function() {
44 | expect(this.$element.tagsinput('items')[0]).toBe('some');
45 | });
46 | });
47 | });
48 | });
--------------------------------------------------------------------------------
/lib/jasmine/src/core/JsApiReporter.js:
--------------------------------------------------------------------------------
1 | getJasmineRequireObj().JsApiReporter = function() {
2 |
3 | var noopTimer = {
4 | start: function(){},
5 | elapsed: function(){ return 0; }
6 | };
7 |
8 | function JsApiReporter(options) {
9 | var timer = options.timer || noopTimer,
10 | status = 'loaded';
11 |
12 | this.started = false;
13 | this.finished = false;
14 |
15 | this.jasmineStarted = function() {
16 | this.started = true;
17 | status = 'started';
18 | timer.start();
19 | };
20 |
21 | var executionTime;
22 |
23 | this.jasmineDone = function() {
24 | this.finished = true;
25 | executionTime = timer.elapsed();
26 | status = 'done';
27 | };
28 |
29 | this.status = function() {
30 | return status;
31 | };
32 |
33 | var suites = {};
34 |
35 | this.suiteStarted = function(result) {
36 | storeSuite(result);
37 | };
38 |
39 | this.suiteDone = function(result) {
40 | storeSuite(result);
41 | };
42 |
43 | function storeSuite(result) {
44 | suites[result.id] = result;
45 | }
46 |
47 | this.suites = function() {
48 | return suites;
49 | };
50 |
51 | var specs = [];
52 | this.specStarted = function(result) { };
53 |
54 | this.specDone = function(result) {
55 | specs.push(result);
56 | };
57 |
58 | this.specResults = function(index, length) {
59 | return specs.slice(index, index + length);
60 | };
61 |
62 | this.specs = function() {
63 | return specs;
64 | };
65 |
66 | this.executionTime = function() {
67 | return executionTime;
68 | };
69 |
70 | }
71 |
72 | return JsApiReporter;
73 | };
74 |
--------------------------------------------------------------------------------
/lib/jasmine/.travis.yml:
--------------------------------------------------------------------------------
1 | ---
2 | script: $TEST_COMMAND
3 | language: ruby
4 | cache: bundler
5 | rvm: 1.9.3
6 | env:
7 | global:
8 | - USE_SAUCE=true
9 | - NOKOGIRI_USE_SYSTEM_LIBRARIES=true
10 | - TEST_COMMAND="bash travis-core-script.sh"
11 | - JASMINE_BROWSER="firefox"
12 | - SAUCE_OS="Linux"
13 | - SAUCE_BROWSER_VERSION=''
14 | - secure: WSPWhlnC4mWSnSPquX+m1/BCu5ch5NygkaHuM2Nea7lD8oS3XLX8QncZZAsQ4lnNfqoDDuBOizG0AESiqNvE4y6x5qvLLTS6q+ce255ZEMZ71TBdZgDEEvGMEjOPPsVXiXyTQOP1lwOPlrbZvaPgWV7e11KIBab6DfFcQpnvDgo=
15 | - secure: SW7CJhZnwaNT749Gdnhvqb5rbXlAOsygUAzh9qhtyvbqXKkmJdBIEsO01YF6pbju1X2twE9JvWCOxeZju43NgQChJlPsGbjY2j3k/TdQeTAJesQe2K7ytwghunI30gjEovtRH0T3w1EmcKPH8yj5eBIcB2OYoJHx8KEC7e68q1g=
16 | matrix:
17 | include:
18 | - env:
19 | - USE_SAUCE=false
20 | - TEST_COMMAND="bash travis-node-script.sh"
21 | - env:
22 | - JASMINE_BROWSER="safari"
23 | - SAUCE_OS="OS X 10.8"
24 | - SAUCE_BROWSER_VERSION=6
25 | - env:
26 | - JASMINE_BROWSER="safari"
27 | - SAUCE_OS="OS X 10.6"
28 | - SAUCE_BROWSER_VERSION=5
29 | - env:
30 | - JASMINE_BROWSER="internet explorer"
31 | - SAUCE_OS="Windows 8"
32 | - SAUCE_BROWSER_VERSION=10
33 | - env:
34 | - JASMINE_BROWSER="internet explorer"
35 | - SAUCE_OS="Windows 7"
36 | - SAUCE_BROWSER_VERSION=9
37 | - env:
38 | - JASMINE_BROWSER="internet explorer"
39 | - SAUCE_OS="Windows 7"
40 | - SAUCE_BROWSER_VERSION=8
41 | - env:
42 | - JASMINE_BROWSER="chrome"
43 | - SAUCE_OS="Linux"
44 | - SAUCE_BROWSER_VERSION=''
45 | - env:
46 | - JASMINE_BROWSER="phantomjs"
47 | - USE_SAUCE=false
48 | - env:
49 | - USE_SAUCE=false
50 | - JASMINE_BROWSER="phantomjs"
51 | - TEST_COMMAND="bash travis-docs-script.sh"
52 |
--------------------------------------------------------------------------------
/lib/jasmine/Gruntfile.js:
--------------------------------------------------------------------------------
1 | module.exports = function(grunt) {
2 | var pkg = require("./package.json");
3 | global.jasmineVersion = pkg.version;
4 |
5 | grunt.initConfig({
6 | pkg: pkg,
7 | jshint: require('./grunt/config/jshint.js'),
8 | concat: require('./grunt/config/concat.js'),
9 | compass: require('./grunt/config/compass.js'),
10 | compress: require('./grunt/config/compress.js')
11 | });
12 |
13 | require('load-grunt-tasks')(grunt);
14 |
15 | grunt.loadTasks('grunt/tasks');
16 |
17 | grunt.registerTask('default', ['jshint:all']);
18 |
19 | var version = require('./grunt/tasks/version.js');
20 | var standaloneBuilder = require('./grunt/tasks/build_standalone.js');
21 |
22 | grunt.registerTask('build:copyVersionToGem',
23 | "Propagates the version from package.json to version.rb",
24 | version.copyToGem);
25 |
26 | grunt.registerTask('buildDistribution',
27 | 'Builds and lints jasmine.js, jasmine-html.js, jasmine.css',
28 | [
29 | 'compass',
30 | 'jshint:beforeConcat',
31 | 'concat',
32 | 'jshint:afterConcat',
33 | 'build:copyVersionToGem'
34 | ]
35 | );
36 |
37 | grunt.registerTask("execSpecsInNode",
38 | "Run Jasmine core specs in Node.js",
39 | function() {
40 | var exitInfo = require("shelljs").exec("node_modules/.bin/jasmine");
41 | if (exitInfo.code !== 0) {
42 | grunt.fail.fatal("Specs Failed", exitInfo.code);
43 | }
44 | }
45 | );
46 |
47 | grunt.registerTask("execSpecsInNode:performance",
48 | "Run Jasmine performance specs in Node.js",
49 | function() {
50 | require("shelljs").exec("node_modules/.bin/jasmine JASMINE_CONFIG_PATH=spec/support/jasmine-performance.json");
51 | }
52 | );
53 | };
54 |
--------------------------------------------------------------------------------
/lib/jasmine/lib/jasmine-core/core.py:
--------------------------------------------------------------------------------
1 | import pkg_resources
2 |
3 | try:
4 | from collections import OrderedDict
5 | except ImportError:
6 | from ordereddict import OrderedDict
7 |
8 | class Core(object):
9 | @classmethod
10 | def js_package(cls):
11 | return __package__
12 |
13 | @classmethod
14 | def css_package(cls):
15 | return __package__
16 |
17 | @classmethod
18 | def image_package(cls):
19 | return __package__ + ".images"
20 |
21 | @classmethod
22 | def js_files(cls):
23 | js_files = sorted(list(filter(lambda x: '.js' in x, pkg_resources.resource_listdir(cls.js_package(), '.'))))
24 |
25 | # jasmine.js needs to be first
26 | js_files.insert(0, 'jasmine.js')
27 |
28 | # boot needs to be last
29 | js_files.remove('boot.js')
30 | js_files.append('boot.js')
31 |
32 | return cls._uniq(js_files)
33 |
34 | @classmethod
35 | def css_files(cls):
36 | return cls._uniq(sorted(filter(lambda x: '.css' in x, pkg_resources.resource_listdir(cls.css_package(), '.'))))
37 |
38 | @classmethod
39 | def favicon(cls):
40 | return 'jasmine_favicon.png'
41 |
42 | @classmethod
43 | def _uniq(self, items, idfun=None):
44 | # order preserving
45 |
46 | if idfun is None:
47 | def idfun(x): return x
48 | seen = {}
49 | result = []
50 | for item in items:
51 | marker = idfun(item)
52 | # in old Python versions:
53 | # if seen.has_key(marker)
54 | # but in new ones:
55 | if marker in seen:
56 | continue
57 |
58 | seen[marker] = 1
59 | result.append(item)
60 | return result
--------------------------------------------------------------------------------
/lib/jasmine/lib/jasmine-core/node_boot.js:
--------------------------------------------------------------------------------
1 | /*
2 | Copyright (c) 2008-2014 Pivotal Labs
3 |
4 | Permission is hereby granted, free of charge, to any person obtaining
5 | a copy of this software and associated documentation files (the
6 | "Software"), to deal in the Software without restriction, including
7 | without limitation the rights to use, copy, modify, merge, publish,
8 | distribute, sublicense, and/or sell copies of the Software, and to
9 | permit persons to whom the Software is furnished to do so, subject to
10 | the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be
13 | included in all copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
16 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
17 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
18 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
19 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
20 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
21 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22 | */
23 | module.exports = function(jasmineRequire) {
24 | var jasmine = jasmineRequire.core(jasmineRequire);
25 |
26 | var consoleFns = require('../console/console.js');
27 | consoleFns.console(consoleFns, jasmine);
28 |
29 | var env = jasmine.getEnv();
30 |
31 | var jasmineInterface = jasmineRequire.interface(jasmine, env);
32 |
33 | extend(global, jasmineInterface);
34 |
35 | function extend(destination, source) {
36 | for (var property in source) destination[property] = source[property];
37 | return destination;
38 | }
39 |
40 | return jasmine;
41 | };
42 |
--------------------------------------------------------------------------------
/lib/jasmine/spec/core/matchers/toHaveBeenCalledSpec.js:
--------------------------------------------------------------------------------
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 |
48 |
--------------------------------------------------------------------------------
/lib/jasmine/grunt/config/compress.js:
--------------------------------------------------------------------------------
1 | var standaloneLibDir = "lib/jasmine-" + jasmineVersion;
2 |
3 | function root(path) { return "./" + path; }
4 | function libJasmineCore(path) { return root("lib/jasmine-core/" + path); }
5 | function libConsole() { return "lib/console/" }
6 | function dist(path) { return root("dist/" + path); }
7 |
8 | module.exports = {
9 | standalone: {
10 | options: {
11 | archive: root("dist/jasmine-standalone-" + global.jasmineVersion + ".zip")
12 | },
13 |
14 | files: [
15 | { src: [ root("MIT.LICENSE") ] },
16 | {
17 | src: [ "jasmine_favicon.png"],
18 | dest: standaloneLibDir,
19 | expand: true,
20 | cwd: root("images")
21 | },
22 | {
23 | src: [
24 | "jasmine.js",
25 | "jasmine-html.js",
26 | "jasmine.css"
27 | ],
28 | dest: standaloneLibDir,
29 | expand: true,
30 | cwd: libJasmineCore("")
31 | },
32 | {
33 | src: [
34 | "console.js"
35 | ],
36 | dest: standaloneLibDir,
37 | expand: true,
38 | cwd: libConsole()
39 | },
40 | {
41 | src: [ "boot.js" ],
42 | dest: standaloneLibDir,
43 | expand: true,
44 | cwd: libJasmineCore("boot")
45 | },
46 | {
47 | src: [ "SpecRunner.html" ],
48 | dest: root(""),
49 | expand: true,
50 | cwd: dist("tmp")
51 | },
52 | {
53 | src: [ "*.js" ],
54 | dest: "src",
55 | expand: true,
56 | cwd: libJasmineCore("example/src/")
57 | },
58 | {
59 | src: [ "*.js" ],
60 | dest: "spec",
61 | expand: true,
62 | cwd: libJasmineCore("example/spec/")
63 | }
64 | ]
65 | }
66 | };
67 |
--------------------------------------------------------------------------------
/lib/jasmine/lib/jasmine-core/example/spec/PlayerSpec.js:
--------------------------------------------------------------------------------
1 | describe("Player", function() {
2 | var player;
3 | var song;
4 |
5 | beforeEach(function() {
6 | player = new Player();
7 | song = new Song();
8 | });
9 |
10 | it("should be able to play a Song", function() {
11 | player.play(song);
12 | expect(player.currentlyPlayingSong).toEqual(song);
13 |
14 | //demonstrates use of custom matcher
15 | expect(player).toBePlaying(song);
16 | });
17 |
18 | describe("when song has been paused", function() {
19 | beforeEach(function() {
20 | player.play(song);
21 | player.pause();
22 | });
23 |
24 | it("should indicate that the song is currently paused", function() {
25 | expect(player.isPlaying).toBeFalsy();
26 |
27 | // demonstrates use of 'not' with a custom matcher
28 | expect(player).not.toBePlaying(song);
29 | });
30 |
31 | it("should be possible to resume", function() {
32 | player.resume();
33 | expect(player.isPlaying).toBeTruthy();
34 | expect(player.currentlyPlayingSong).toEqual(song);
35 | });
36 | });
37 |
38 | // demonstrates use of spies to intercept and test method calls
39 | it("tells the current song if the user has made it a favorite", function() {
40 | spyOn(song, 'persistFavoriteStatus');
41 |
42 | player.play(song);
43 | player.makeFavorite();
44 |
45 | expect(song.persistFavoriteStatus).toHaveBeenCalledWith(true);
46 | });
47 |
48 | //demonstrates use of expected exceptions
49 | describe("#resume", function() {
50 | it("should throw an exception if song is already playing", function() {
51 | player.play(song);
52 |
53 | expect(function() {
54 | player.resume();
55 | }).toThrowError("song is already playing");
56 | });
57 | });
58 | });
59 |
--------------------------------------------------------------------------------
/lib/jasmine/spec/html/ResultsNodeSpec.js:
--------------------------------------------------------------------------------
1 | describe("ResultsNode", function() {
2 | it("wraps a result", function() {
3 | var fakeResult = {
4 | id: 123,
5 | message: "foo"
6 | },
7 | node = new j$.ResultsNode(fakeResult, "suite", null);
8 |
9 | expect(node.result).toBe(fakeResult);
10 | expect(node.type).toEqual("suite");
11 | });
12 |
13 | it("can add children with a type", function() {
14 | var fakeResult = {
15 | id: 123,
16 | message: "foo"
17 | },
18 | fakeChildResult = {
19 | id: 456,
20 | message: "bar"
21 | },
22 | node = new j$.ResultsNode(fakeResult, "suite", null);
23 |
24 | node.addChild(fakeChildResult, "spec");
25 |
26 | expect(node.children.length).toEqual(1);
27 | expect(node.children[0].result).toEqual(fakeChildResult);
28 | expect(node.children[0].type).toEqual("spec");
29 | });
30 |
31 | it("has a pointer back to its parent ResultNode", function() {
32 | var fakeResult = {
33 | id: 123,
34 | message: "foo"
35 | },
36 | fakeChildResult = {
37 | id: 456,
38 | message: "bar"
39 | },
40 | node = new j$.ResultsNode(fakeResult, "suite", null);
41 |
42 | node.addChild(fakeChildResult, "spec");
43 |
44 | expect(node.children[0].parent).toBe(node);
45 | });
46 |
47 | it("can provide the most recent child", function() {
48 | var fakeResult = {
49 | id: 123,
50 | message: "foo"
51 | },
52 | fakeChildResult = {
53 | id: 456,
54 | message: "bar"
55 | },
56 | node = new j$.ResultsNode(fakeResult, "suite", null);
57 |
58 | node.addChild(fakeChildResult, "spec");
59 |
60 | expect(node.last()).toBe(node.children[node.children.length - 1]);
61 | });
62 | });
63 |
--------------------------------------------------------------------------------
/test/bootstrap-tagsinput/events.tests.js:
--------------------------------------------------------------------------------
1 | describe("bootstrap-tagsinput", function() {
2 |
3 | describe("events", function() {
4 | testTagsInput('', function() {
5 | it("beforeItemAdd canceled", function() {
6 | this.$element.on('beforeItemAdd', function(event) {
7 | event.cancel = true;
8 | });
9 | this.$element.tagsinput('add', 'some');
10 | expect(this.$element.tagsinput('items').length).toBe(0);
11 | });
12 | });
13 |
14 | testTagsInput('', function() {
15 | it("beforeItemRemove canceled", function() {
16 | this.$element.on('beforeItemRemove', function(event) {
17 | event.cancel = true;
18 | });
19 | this.$element.tagsinput('remove', '1');
20 | expect(this.$element.tagsinput('items').length).toBe(1);
21 | });
22 | });
23 |
24 | testTagsInput('', { triggerChange: false }, function() {
25 | it("triggerChange 'true' test", function() {
26 | var triggerChange = false;
27 | this.$element.on('change', function(event) {
28 | triggerChange = true;
29 | });
30 | this.$element.tagsinput('remove', '1');
31 | this.$element.tagsinput('add', 'some');
32 | expect(triggerChange).toBe(false);
33 | });
34 | });
35 |
36 | testTagsInput('' , function() {
37 | it("triggerChange 'false' test", function() {
38 | var triggerChange = false;
39 | this.$element.on('change', function(event) {
40 | triggerChange = true;
41 | });
42 | this.$element.tagsinput('remove', '1');
43 | this.$element.tagsinput('add', 'some');
44 | expect(triggerChange).toBe(true);
45 | });
46 | });
47 | });
48 | });
49 |
--------------------------------------------------------------------------------
/test/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Jasmine Test Runner
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
--------------------------------------------------------------------------------
/lib/jasmine/lib/jasmine-core/example/node_example/spec/PlayerSpec.js:
--------------------------------------------------------------------------------
1 | describe("Player", function() {
2 | var Player = require('../../jasmine_examples/Player.js');
3 | var Song = require('../../jasmine_examples/Song.js');
4 | var player;
5 | var song;
6 |
7 | beforeEach(function() {
8 | player = new Player();
9 | song = new Song();
10 | });
11 |
12 | it("should be able to play a Song", function() {
13 | player.play(song);
14 | expect(player.currentlyPlayingSong).toEqual(song);
15 |
16 | //demonstrates use of custom matcher
17 | expect(player).toBePlaying(song);
18 | });
19 |
20 | describe("when song has been paused", function() {
21 | beforeEach(function() {
22 | player.play(song);
23 | player.pause();
24 | });
25 |
26 | it("should indicate that the song is currently paused", function() {
27 | expect(player.isPlaying).toBeFalsy();
28 |
29 | // demonstrates use of 'not' with a custom matcher
30 | expect(player).not.toBePlaying(song);
31 | });
32 |
33 | it("should be possible to resume", function() {
34 | player.resume();
35 | expect(player.isPlaying).toBeTruthy();
36 | expect(player.currentlyPlayingSong).toEqual(song);
37 | });
38 | });
39 |
40 | // demonstrates use of spies to intercept and test method calls
41 | it("tells the current song if the user has made it a favorite", function() {
42 | spyOn(song, 'persistFavoriteStatus');
43 |
44 | player.play(song);
45 | player.makeFavorite();
46 |
47 | expect(song.persistFavoriteStatus).toHaveBeenCalledWith(true);
48 | });
49 |
50 | //demonstrates use of expected exceptions
51 | describe("#resume", function() {
52 | it("should throw an exception if song is already playing", function() {
53 | player.play(song);
54 |
55 | expect(function() {
56 | player.resume();
57 | }).toThrowError("song is already playing");
58 | });
59 | });
60 | });
61 |
--------------------------------------------------------------------------------
/dist/bootstrap-tagsinput-angular.min.js.map:
--------------------------------------------------------------------------------
1 | {"version":3,"sources":["../src/bootstrap-tagsinput-angular.js"],"names":["angular","module","directive","getItemProperty","scope","property","isFunction","$parent","item","restrict","model","template","replace","link","element","attrs","$","isArray","select","typeaheadSourceArray","typeaheadSource","split","length","tagsinput","options","typeahead","source","itemValue","itemvalue","itemText","itemtext","confirmKeys","confirmkeys","JSON","parse","tagClass","tagclass","i","on","event","indexOf","push","idx","splice","prev","slice","$watch","added","filter","removed"],"mappings":";;;;;AAAAA,QAAQC,OAAO,0BACdC,UAAU,sBAAuB,WAEhC,QAASC,GAAgBC,EAAOC,GAC9B,GAAKA,EAGL,MAAIL,SAAQM,WAAWF,EAAMG,QAAQF,IAC5BD,EAAMG,QAAQF,GAEhB,SAASG,GACd,MAAOA,GAAKH,IAIhB,OACEI,SAAU,KACVL,OACEM,MAAO,YAETC,SAAU,6BACVC,SAAS,EACTC,KAAM,SAAST,EAAOU,EAASC,GAC7BC,EAAE,WACKhB,QAAQiB,QAAQb,EAAMM,SACzBN,EAAMM,SAER,IAAIQ,GAASF,EAAE,SAAUF,GACrBK,EAAuBJ,EAAMK,gBAAkBL,EAAMK,gBAAgBC,MAAM,KAAO,KAClFD,EAAkBD,EACjBA,EAAqBG,OAAS,EAC3BlB,EAAMG,QAAQY,EAAqB,IAAIA,EAAqB,IAC1Df,EAAMG,QAAQY,EAAqB,IACvC,IAEND,GAAOK,UAAUnB,EAAMG,QAAQQ,EAAMS,SAAW,MAC9CC,WACEC,OAAW1B,QAAQM,WAAWc,GAAmBA,EAAkB,MAErEO,UAAWxB,EAAgBC,EAAOW,EAAMa,WACxCC,SAAW1B,EAAgBC,EAAOW,EAAMe,UACxCC,YAAc5B,EAAgBC,EAAOW,EAAMiB,aAAeC,KAAKC,MAAMnB,EAAMiB,cAAgB,IAC3FG,SAAWnC,QAAQM,WAAWF,EAAMG,QAAQQ,EAAMqB,WAAahC,EAAMG,QAAQQ,EAAMqB,UAAY,SAAS5B,GAAQ,MAAOO,GAAMqB,WAG/H,KAAK,GAAIC,GAAI,EAAGA,EAAIjC,EAAMM,MAAMY,OAAQe,IACtCnB,EAAOK,UAAU,MAAOnB,EAAMM,MAAM2B,GAGtCnB,GAAOoB,GAAG,YAAa,SAASC,GAC1BnC,EAAMM,MAAM8B,QAAQD,EAAM/B,SAAU,GACtCJ,EAAMM,MAAM+B,KAAKF,EAAM/B,QAG3BU,EAAOoB,GAAG,cAAe,SAASC,GAChC,GAAIG,GAAMtC,EAAMM,MAAM8B,QAAQD,EAAM/B,KAChCkC,MAAQ,GACVtC,EAAMM,MAAMiC,OAAOD,EAAK,IAK5B,IAAIE,GAAOxC,EAAMM,MAAMmC,OACvBzC,GAAM0C,OAAO,QAAS,WACpB,GAEIT,GAFAU,EAAQ3C,EAAMM,MAAMsC,OAAO,SAASX,GAAI,MAAOO,GAAKJ,QAAQH,MAAO,IACnEY,EAAUL,EAAKI,OAAO,SAASX,GAAI,MAAOjC,GAAMM,MAAM8B,QAAQH,MAAO,GAMzE,KAHAO,EAAOxC,EAAMM,MAAMmC,QAGdR,EAAI,EAAGA,EAAIY,EAAQ3B,OAAQe,IAC9BnB,EAAOK,UAAU,SAAU0B,EAAQZ,GAOrC,KAHAnB,EAAOK,UAAU,WAGZc,EAAI,EAAGA,EAAIU,EAAMzB,OAAQe,IAC5BnB,EAAOK,UAAU,MAAOwB,EAAMV,MAE/B","file":"bootstrap-tagsinput-angular.min.js"}
--------------------------------------------------------------------------------
/lib/jasmine/setup.py:
--------------------------------------------------------------------------------
1 | from setuptools import setup, find_packages, os
2 | import json
3 |
4 | with open('package.json') as packageFile:
5 | version = json.load(packageFile)['version']
6 |
7 | setup(
8 | name="jasmine-core",
9 | version=version,
10 | url="http://pivotal.github.io/jasmine/",
11 | author="Pivotal Labs",
12 | author_email="jasmine-js@googlegroups.com",
13 | description=('Jasmine is a Behavior Driven Development testing framework for JavaScript. It does not rely on '+
14 | 'browsers, DOM, or any JavaScript framework. Thus it\'s suited for websites, '+
15 | 'Node.js (http://nodejs.org) projects, or anywhere that JavaScript can run.'),
16 | license='MIT',
17 | classifiers=[
18 | 'Development Status :: 5 - Production/Stable',
19 | 'Environment :: Console',
20 | 'Environment :: Web Environment',
21 | 'Framework :: Django',
22 | 'Intended Audience :: Developers',
23 | 'License :: OSI Approved :: MIT License',
24 | 'Operating System :: OS Independent',
25 | 'Programming Language :: Python',
26 | 'Programming Language :: Python :: 2',
27 | 'Programming Language :: Python :: 2.6',
28 | 'Programming Language :: Python :: 2.7',
29 | 'Programming Language :: Python :: 3',
30 | 'Programming Language :: Python :: 3.2',
31 | 'Programming Language :: Python :: 3.3',
32 | 'Programming Language :: Python :: Implementation :: PyPy',
33 | 'Topic :: Internet :: WWW/HTTP',
34 | 'Topic :: Software Development :: Libraries :: Python Modules',
35 | 'Topic :: Software Development :: Build Tools',
36 | 'Topic :: Software Development :: Quality Assurance',
37 | 'Topic :: Software Development :: Testing',
38 | ],
39 |
40 | packages=['jasmine_core', 'jasmine_core.images'],
41 | package_dir={'jasmine_core': 'lib/jasmine-core', 'jasmine_core.images': 'images'},
42 | package_data={'jasmine_core': ['*.js', '*.css'], 'jasmine_core.images': ['*.png']},
43 |
44 | include_package_data=True,
45 |
46 | install_requires=['glob2>=0.4.1', 'ordereddict==1.1']
47 | )
48 |
--------------------------------------------------------------------------------
/lib/jasmine/spec/core/ExceptionsSpec.js:
--------------------------------------------------------------------------------
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 |
69 |
--------------------------------------------------------------------------------
/lib/jasmine/spec/core/ExpectationResultSpec.js:
--------------------------------------------------------------------------------
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 | });
62 |
--------------------------------------------------------------------------------
/lib/jasmine/spec/core/ExceptionFormatterSpec.js:
--------------------------------------------------------------------------------
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 | });
64 |
--------------------------------------------------------------------------------
/lib/jasmine/src/core/Suite.js:
--------------------------------------------------------------------------------
1 | getJasmineRequireObj().Suite = function() {
2 | function Suite(attrs) {
3 | this.env = attrs.env;
4 | this.id = attrs.id;
5 | this.parentSuite = attrs.parentSuite;
6 | this.description = attrs.description;
7 | this.onStart = attrs.onStart || function() {};
8 | this.resultCallback = attrs.resultCallback || function() {};
9 | this.clearStack = attrs.clearStack || function(fn) {fn();};
10 |
11 | this.beforeFns = [];
12 | this.afterFns = [];
13 | this.queueRunner = attrs.queueRunner || function() {};
14 | this.disabled = false;
15 |
16 | this.children = [];
17 |
18 | this.result = {
19 | id: this.id,
20 | status: this.disabled ? 'disabled' : '',
21 | description: this.description,
22 | fullName: this.getFullName()
23 | };
24 | }
25 |
26 | Suite.prototype.getFullName = function() {
27 | var fullName = this.description;
28 | for (var parentSuite = this.parentSuite; parentSuite; parentSuite = parentSuite.parentSuite) {
29 | if (parentSuite.parentSuite) {
30 | fullName = parentSuite.description + ' ' + fullName;
31 | }
32 | }
33 | return fullName;
34 | };
35 |
36 | Suite.prototype.disable = function() {
37 | this.disabled = true;
38 | this.result.status = 'disabled';
39 | };
40 |
41 | Suite.prototype.beforeEach = function(fn) {
42 | this.beforeFns.unshift(fn);
43 | };
44 |
45 | Suite.prototype.afterEach = function(fn) {
46 | this.afterFns.unshift(fn);
47 | };
48 |
49 | Suite.prototype.addChild = function(child) {
50 | this.children.push(child);
51 | };
52 |
53 | Suite.prototype.execute = function(onComplete) {
54 | var self = this;
55 |
56 | this.onStart(this);
57 |
58 | if (this.disabled) {
59 | complete();
60 | return;
61 | }
62 |
63 | var allFns = [];
64 |
65 | for (var i = 0; i < this.children.length; i++) {
66 | allFns.push(wrapChildAsAsync(this.children[i]));
67 | }
68 |
69 | this.queueRunner({
70 | fns: allFns,
71 | onComplete: complete
72 | });
73 |
74 | function complete() {
75 | self.resultCallback(self.result);
76 |
77 | if (onComplete) {
78 | onComplete();
79 | }
80 | }
81 |
82 | function wrapChildAsAsync(child) {
83 | return function(done) { child.execute(done); };
84 | }
85 | };
86 |
87 | return Suite;
88 | };
89 |
90 | if (typeof window == void 0 && typeof exports == 'object') {
91 | exports.Suite = jasmineRequire.Suite;
92 | }
93 |
--------------------------------------------------------------------------------
/lib/jasmine/GOALS_2.0.md:
--------------------------------------------------------------------------------
1 | # (Vague) Jasmine 2.0 Goals/(Guidelines)
2 |
3 | 1. No globals!
4 | * jasmine library is entirely inside `jasmine` namespace
5 | * globals required for backwards compatibility should be added in `boot.js` (EG, var describe = jasmine.getCurrentEnv().describe lives in boot.js)
6 | 1. Don't use properties as getters. Use methods.
7 | * Properties aren't encapsulated -- can be mutated, unsafe.
8 | 1. Reporters get data objects (no methods).
9 | * easier to refactor as needed
10 | 1. More unit tests - fewer nasty integration tests
11 |
12 | ## Remaining non-story-able work:
13 | * Make a `TODO` list
14 |
15 | ### Hard
16 | * Finish killing Globals
17 | * Guidelines:
18 | * New objects can have constructors on `jasmine`
19 | * Top level functions can live on `jasmine`
20 | * Top level (i.e., any `jasmine` property) should only be referenced inside the `Env` constructor
21 | * should better allow any object to get jasmine code (Node-friendly)
22 | * review everything in base.js
23 | * Remove isA functions:
24 | * isArray_ - used in matchers and spies
25 | * isString_
26 | * isDOMNode_
27 | * isA_
28 | * unimplementedMethod_, used by PrettyPrinter
29 | * jasmine.util should be util closure inside of env or something
30 | * argsToArray is used for Spies and matching (and can be replaced)
31 | * inherit is only for PrettyPrinter now
32 | * formatException is used only inside Env/spec
33 | * htmlEscape is for messages in matchers - should this be HTML at all?
34 | * Pretty printing
35 | * move away from pretty printer and to a JSON.stringify implementation?
36 | * jasmineToString vs. custom toString ?
37 |
38 | ### Easy
39 |
40 | * unify params to ctors: options vs. attrs.
41 | * This will be a lot of the TODOs, but clean up & simplify Env.js (is this a 2.1 task?)
42 |
43 | ### DONE
44 | * Matchers improvements
45 | * unit testable DONE
46 | * better equality (from Underscore) DONE
47 | * addCustomMatchers doesn't explode stack DONE
48 | * refactor equals function so that it just loops & recurses over a list of fns (custom and built-in) - 2.1? (Tracker story)
49 | * Spies
50 | * break these out into their own tests/file DONE
51 |
52 |
53 | ## Other Topics
54 |
55 | * Docs
56 | * Docco has gone over well. Should we annotate all the sources and then have Pages be more complex, having tutorials and annotated source like Backbone? Are we small enough?
57 | * Need examples for:
58 | * How to build a Custom Matcher
59 | * How to add a custom equality tester
60 |
61 |
62 |
63 |
64 |
65 |
--------------------------------------------------------------------------------
/lib/jasmine/src/core/MockDate.js:
--------------------------------------------------------------------------------
1 | getJasmineRequireObj().MockDate = function() {
2 | function MockDate(global) {
3 | var self = this;
4 | var currentTime = 0;
5 |
6 | if (!global || !global.Date) {
7 | self.install = function() {};
8 | self.tick = function() {};
9 | self.uninstall = function() {};
10 | return self;
11 | }
12 |
13 | var GlobalDate = global.Date;
14 |
15 | self.install = function(mockDate) {
16 | if (mockDate instanceof GlobalDate) {
17 | currentTime = mockDate.getTime();
18 | } else {
19 | currentTime = new GlobalDate().getTime();
20 | }
21 |
22 | global.Date = FakeDate;
23 | };
24 |
25 | self.tick = function(millis) {
26 | millis = millis || 0;
27 | currentTime = currentTime + millis;
28 | };
29 |
30 | self.uninstall = function() {
31 | currentTime = 0;
32 | global.Date = GlobalDate;
33 | };
34 |
35 | createDateProperties();
36 |
37 | return self;
38 |
39 | function FakeDate() {
40 | switch(arguments.length) {
41 | case 0:
42 | return new GlobalDate(currentTime);
43 | case 1:
44 | return new GlobalDate(arguments[0]);
45 | case 2:
46 | return new GlobalDate(arguments[0], arguments[1]);
47 | case 3:
48 | return new GlobalDate(arguments[0], arguments[1], arguments[2]);
49 | case 4:
50 | return new GlobalDate(arguments[0], arguments[1], arguments[2], arguments[3]);
51 | case 5:
52 | return new GlobalDate(arguments[0], arguments[1], arguments[2], arguments[3],
53 | arguments[4]);
54 | case 6:
55 | return new GlobalDate(arguments[0], arguments[1], arguments[2], arguments[3],
56 | arguments[4], arguments[5]);
57 | case 7:
58 | return new GlobalDate(arguments[0], arguments[1], arguments[2], arguments[3],
59 | arguments[4], arguments[5], arguments[6]);
60 | }
61 | }
62 |
63 | function createDateProperties() {
64 |
65 | FakeDate.now = function() {
66 | if (GlobalDate.now) {
67 | return currentTime;
68 | } else {
69 | throw new Error('Browser does not support Date.now()');
70 | }
71 | };
72 |
73 | FakeDate.toSource = GlobalDate.toSource;
74 | FakeDate.toString = GlobalDate.toString;
75 | FakeDate.parse = GlobalDate.parse;
76 | FakeDate.UTC = GlobalDate.UTC;
77 | }
78 | }
79 |
80 | return MockDate;
81 | };
82 |
--------------------------------------------------------------------------------
/lib/jasmine/spec/core/EnvSpec.js:
--------------------------------------------------------------------------------
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 |
86 |
--------------------------------------------------------------------------------
/lib/jasmine/spec/core/ObjectContainingSpec.js:
--------------------------------------------------------------------------------
1 | describe("ObjectContaining", function() {
2 |
3 | it("matches any actual to an empty object", function() {
4 | var containing = new j$.ObjectContaining({});
5 |
6 | expect(containing.jasmineMatches("foo")).toBe(true);
7 | });
8 |
9 | it("does not match an empty object actual", function() {
10 | var containing = new j$.ObjectContaining("foo");
11 |
12 | expect(function() {
13 | containing.jasmineMatches({})
14 | }).toThrowError(/not 'foo'/)
15 | });
16 |
17 | it("matches when the key/value pair is present in the actual", function() {
18 | var containing = new j$.ObjectContaining({foo: "fooVal"});
19 |
20 | expect(containing.jasmineMatches({foo: "fooVal", bar: "barVal"})).toBe(true);
21 | });
22 |
23 | it("does not match when the key/value pair is not present in the actual", function() {
24 | var containing = new j$.ObjectContaining({foo: "fooVal"});
25 |
26 | expect(containing.jasmineMatches({bar: "barVal", quux: "quuxVal"})).toBe(false);
27 | });
28 |
29 | it("does not match when the key is present but the value is different in the actual", function() {
30 | var containing = new j$.ObjectContaining({foo: "other"});
31 |
32 | expect(containing.jasmineMatches({foo: "fooVal", bar: "barVal"})).toBe(false);
33 | });
34 |
35 | it("mismatchValues parameter must return array with mismatched reason", function() {
36 | var containing = new j$.ObjectContaining({foo: "other"});
37 |
38 | var mismatchKeys = [];
39 | var mismatchValues = [];
40 |
41 | containing.jasmineMatches({foo: "fooVal", bar: "barVal"}, mismatchKeys, mismatchValues);
42 |
43 | expect(mismatchValues.length).toBe(1);
44 | expect(mismatchValues[0]).toEqual("'foo' was 'fooVal' in actual, but was 'other' in expected.");
45 | });
46 |
47 | it("adds keys in expected but not actual to the mismatchKeys parameter", function() {
48 | var containing = new j$.ObjectContaining({foo: "fooVal"});
49 |
50 | var mismatchKeys = [];
51 | var mismatchValues = [];
52 |
53 | containing.jasmineMatches({bar: "barVal"}, mismatchKeys, mismatchValues);
54 |
55 | expect(mismatchKeys.length).toBe(1);
56 | expect(mismatchKeys[0]).toEqual("expected has key 'foo', but missing from actual.");
57 | });
58 |
59 | it("jasmineToString's itself", function() {
60 | var containing = new j$.ObjectContaining({});
61 |
62 | expect(containing.jasmineToString()).toMatch("'))($scope);
15 | $scope.$digest();
16 | }));
17 |
18 | it('should hide the element', function() {
19 | expect($element.is(":visible")).toBe(false);
20 | });
21 |
22 | it('should have 2 tags', function() {
23 | expect($('.tag', $element).length).toBe(2);
24 | });
25 | });
26 | });
27 |
28 | describe("with objects as items" , function() {
29 | describe("compile with 2 tags in model" , function() {
30 | var $scope,
31 | $element;
32 |
33 | beforeEach(inject(function($compile, $rootScope){
34 | $scope = $rootScope;
35 | $scope.tags = [{ value: 1, text: 'Amsterdam'}, { value: 2, text: 'New York'} ];
36 | $element = $compile(angular.element(''))($scope);
37 | $scope.$digest();
38 | }));
39 |
40 | it('should hide the element', function() {
41 | expect($element.is(":visible")).toBe(false);
42 | });
43 |
44 | it('should have 2 tags', function() {
45 | expect($('.tag', $element).length).toBe(2);
46 | });
47 | describe("changing a tag's text" , function() {
48 | beforeEach(function() {
49 | $scope.tags[0].text = 'Paris';
50 | $scope.$digest();
51 | });
52 | it("should update tag's text", function() {
53 | expect($('.tag', $element).first().text()).toBe('Paris');
54 | });
55 | });
56 |
57 | describe("adding an item to the model" , function() {
58 | beforeEach(function() {
59 | $scope.tags.push({ value: 3, text: 'Beijing'});
60 | $scope.$digest();
61 | });
62 | it("should add a tag", function() {
63 | expect($('.tag', $element).length).toBe(3);
64 | });
65 | });
66 |
67 | describe("BACKSPACE", function() {
68 | beforeEach(function() {
69 | $element.tagsinput('focus');
70 | });
71 |
72 | it('after last tag, should remove item from model', function() {
73 | $('input', $element).trigger($.Event('keydown', { which: 8 }));
74 | $scope.$digest();
75 | expect($scope.tags.length).toBe(1);
76 | });
77 | });
78 | });
79 | });
80 | });
--------------------------------------------------------------------------------
/lib/jasmine/src/core/QueueRunner.js:
--------------------------------------------------------------------------------
1 | getJasmineRequireObj().QueueRunner = function(j$) {
2 |
3 | function once(fn) {
4 | var called = false;
5 | return function() {
6 | if (!called) {
7 | called = true;
8 | fn();
9 | }
10 | };
11 | }
12 |
13 | function QueueRunner(attrs) {
14 | this.fns = attrs.fns || [];
15 | this.onComplete = attrs.onComplete || function() {};
16 | this.clearStack = attrs.clearStack || function(fn) {fn();};
17 | this.onException = attrs.onException || function() {};
18 | this.catchException = attrs.catchException || function() { return true; };
19 | this.enforceTimeout = attrs.enforceTimeout || function() { return false; };
20 | this.userContext = {};
21 | this.timer = attrs.timeout || {setTimeout: setTimeout, clearTimeout: clearTimeout};
22 | }
23 |
24 | QueueRunner.prototype.execute = function() {
25 | this.run(this.fns, 0);
26 | };
27 |
28 | QueueRunner.prototype.run = function(fns, recursiveIndex) {
29 | var length = fns.length,
30 | self = this,
31 | iterativeIndex;
32 |
33 | for(iterativeIndex = recursiveIndex; iterativeIndex < length; iterativeIndex++) {
34 | var fn = fns[iterativeIndex];
35 | if (fn.length > 0) {
36 | return attemptAsync(fn);
37 | } else {
38 | attemptSync(fn);
39 | }
40 | }
41 |
42 | var runnerDone = iterativeIndex >= length;
43 |
44 | if (runnerDone) {
45 | this.clearStack(this.onComplete);
46 | }
47 |
48 | function attemptSync(fn) {
49 | try {
50 | fn.call(self.userContext);
51 | } catch (e) {
52 | handleException(e);
53 | }
54 | }
55 |
56 | function attemptAsync(fn) {
57 | var clearTimeout = function () {
58 | Function.prototype.apply.apply(self.timer.clearTimeout, [j$.getGlobal(), [timeoutId]]);
59 | },
60 | next = once(function () {
61 | clearTimeout(timeoutId);
62 | self.run(fns, iterativeIndex + 1);
63 | }),
64 | timeoutId;
65 |
66 | if (self.enforceTimeout()) {
67 | timeoutId = Function.prototype.apply.apply(self.timer.setTimeout, [j$.getGlobal(), [function() {
68 | self.onException(new Error('Timeout - Async callback was not invoked within timeout specified by jasmine.DEFAULT_TIMEOUT_INTERVAL.'));
69 | next();
70 | }, j$.DEFAULT_TIMEOUT_INTERVAL]]);
71 | }
72 |
73 | try {
74 | fn.call(self.userContext, next);
75 | } catch (e) {
76 | handleException(e);
77 | next();
78 | }
79 | }
80 |
81 | function handleException(e) {
82 | self.onException(e);
83 | if (!self.catchException(e)) {
84 | //TODO: set a var when we catch an exception and
85 | //use a finally block to close the loop in a nice way..
86 | throw e;
87 | }
88 | }
89 | };
90 |
91 | return QueueRunner;
92 | };
93 |
--------------------------------------------------------------------------------
/Gruntfile.js:
--------------------------------------------------------------------------------
1 | module.exports = function(grunt) {
2 |
3 | grunt.loadNpmTasks('grunt-contrib-copy');
4 | grunt.loadNpmTasks('grunt-contrib-uglify');
5 | grunt.loadNpmTasks('grunt-karma');
6 | grunt.loadNpmTasks('grunt-zip');
7 | grunt.loadNpmTasks('grunt-jquerymanifest');
8 | grunt.loadNpmTasks('grunt-bower-task');
9 | grunt.loadNpmTasks('grunt-banner');
10 |
11 | grunt.initConfig({
12 | pkg: grunt.file.readJSON('package.json'),
13 | bower: {
14 | install: {
15 | options: {
16 | targetDir: './lib',
17 | layout: 'byType',
18 | install: true,
19 | verbose: true,
20 | cleanTargetDir: false,
21 | cleanBowerDir: true,
22 | bowerOptions: {
23 | forceLatest: true
24 | }
25 | }
26 | }
27 | },
28 | copy: {
29 | versioned: {
30 | files: [
31 | { expand: true, flatten: true, src: ['src/*.*'], dest: 'versioned/', filter: 'isFile' }
32 | ]
33 | },
34 | build: {
35 | files: [
36 | { expand: true, flatten: true, src: ['versioned/*.*'], dest: 'dist/', filter: 'isFile' }
37 | ]
38 | }
39 | },
40 | uglify: {
41 | options: {
42 | banner: '<%= pkg.banner %>',
43 | sourceMap: 'dist/<%= pkg.name %>.min.js.map',
44 | sourceMappingURL: '<%= pkg.name %>.min.js.map'
45 | },
46 | build: {
47 | files: {
48 | 'dist/<%= pkg.name %>.min.js': 'src/<%= pkg.name %>.js',
49 | 'dist/<%= pkg.name %>-angular.min.js': 'src/<%= pkg.name %>-angular.js'
50 | }
51 | }
52 | },
53 | karma: {
54 | unit: {
55 | configFile: 'karma.conf.js',
56 | runnerPort: 9999,
57 | singleRun: true,
58 | autoWatch: false,
59 | browsers: ['PhantomJS']
60 | }
61 | },
62 | zip: {
63 | delpoy: {
64 | // cwd: 'dist/',
65 | src: [
66 | 'dist/bootstrap-tagsinput*.js',
67 | 'dist/bootstrap-tagsinput*.css',
68 | 'dist/bootstrap-tagsinput*.less',
69 | 'dist/bootstrap-tagsinput*.map'
70 | ],
71 | dest: 'dist/<%= pkg.name %>.zip'
72 | }
73 | },
74 | jquerymanifest: {
75 | options: {
76 | source: grunt.file.readJSON('package.json'),
77 | overrides: {
78 | title: '<%= pkg.title %>'
79 | }
80 | }
81 | },
82 | usebanner: {
83 | taskName: {
84 | options: {
85 | position: 'top',
86 | banner: '<%= pkg.banner %>',
87 | linebreak: true
88 | },
89 | files: {
90 | src: [ 'versioned/*.*' ]
91 | }
92 | }
93 | }
94 | });
95 |
96 | grunt.registerTask('install', ['bower']);
97 | grunt.registerTask('compile', ['copy:versioned', 'usebanner', 'uglify', 'copy:build']);
98 | grunt.registerTask('test', ['compile', 'karma']);
99 | grunt.registerTask('build', ['test', 'jquerymanifest', 'zip']);
100 | };
101 |
--------------------------------------------------------------------------------
/examples/assets/app_bs3.js:
--------------------------------------------------------------------------------
1 | var citynames = new Bloodhound({
2 | datumTokenizer: Bloodhound.tokenizers.obj.whitespace('name'),
3 | queryTokenizer: Bloodhound.tokenizers.whitespace,
4 | prefetch: {
5 | url: 'assets/citynames.json',
6 | filter: function(list) {
7 | return $.map(list, function(cityname) {
8 | return { name: cityname }; });
9 | }
10 | }
11 | });
12 | citynames.initialize();
13 |
14 | var cities = new Bloodhound({
15 | datumTokenizer: Bloodhound.tokenizers.obj.whitespace('text'),
16 | queryTokenizer: Bloodhound.tokenizers.whitespace,
17 | prefetch: 'assets/cities.json'
18 | });
19 | cities.initialize();
20 |
21 | /**
22 | * Typeahead
23 | */
24 | var elt = $('.example_typeahead > > input');
25 | elt.tagsinput({
26 | typeaheadjs: {
27 | name: 'citynames',
28 | displayKey: 'name',
29 | valueKey: 'name',
30 | source: citynames.ttAdapter()
31 | }
32 | });
33 |
34 | /**
35 | * Objects as tags
36 | */
37 | elt = $('.example_objects_as_tags > > input');
38 | elt.tagsinput({
39 | itemValue: 'value',
40 | itemText: 'text',
41 | typeaheadjs: {
42 | name: 'cities',
43 | displayKey: 'text',
44 | source: cities.ttAdapter()
45 | }
46 | });
47 |
48 | elt.tagsinput('add', { "value": 1 , "text": "Amsterdam" , "continent": "Europe" });
49 | elt.tagsinput('add', { "value": 4 , "text": "Washington" , "continent": "America" });
50 | elt.tagsinput('add', { "value": 7 , "text": "Sydney" , "continent": "Australia" });
51 | elt.tagsinput('add', { "value": 10, "text": "Beijing" , "continent": "Asia" });
52 | elt.tagsinput('add', { "value": 13, "text": "Cairo" , "continent": "Africa" });
53 |
54 | /**
55 | * Categorizing tags
56 | */
57 | elt = $('.example_tagclass > > input');
58 | elt.tagsinput({
59 | tagClass: function(item) {
60 | switch (item.continent) {
61 | case 'Europe' : return 'label label-primary';
62 | case 'America' : return 'label label-danger label-important';
63 | case 'Australia': return 'label label-success';
64 | case 'Africa' : return 'label label-default';
65 | case 'Asia' : return 'label label-warning';
66 | }
67 | },
68 | itemValue: 'value',
69 | itemText: 'text',
70 | // typeaheadjs: {
71 | // name: 'cities',
72 | // displayKey: 'text',
73 | // source: cities.ttAdapter()
74 | // }
75 | typeaheadjs: [
76 | {
77 | hint: true,
78 | highlight: true,
79 | minLength: 2
80 | },
81 | {
82 | name: 'cities',
83 | displayKey: 'text',
84 | source: cities.ttAdapter()
85 | }
86 | ]
87 | });
88 | elt.tagsinput('add', { "value": 1 , "text": "Amsterdam" , "continent": "Europe" });
89 | elt.tagsinput('add', { "value": 4 , "text": "Washington" , "continent": "America" });
90 | elt.tagsinput('add', { "value": 7 , "text": "Sydney" , "continent": "Australia" });
91 | elt.tagsinput('add', { "value": 10, "text": "Beijing" , "continent": "Asia" });
92 | elt.tagsinput('add', { "value": 13, "text": "Cairo" , "continent": "Africa" });
93 |
94 | // HACK: overrule hardcoded display inline-block of typeahead.js
95 | $(".twitter-typeahead").css('display', 'inline');
96 |
--------------------------------------------------------------------------------
/lib/jasmine/RELEASE.md:
--------------------------------------------------------------------------------
1 | # How to work on a Jasmine Release
2 |
3 | ## Development
4 | ___Jasmine Core Maintainers Only___
5 |
6 | Follow the instructions in `CONTRIBUTING.md` during development.
7 |
8 | ### Git Rules
9 |
10 | Please work on feature branches.
11 |
12 | Please attempt to keep commits to `master` small, but cohesive. If a feature is contained in a bunch of small commits (e.g., it has several wip commits or small work), please squash them when merging back to `master`.
13 |
14 | ### Version
15 |
16 | We attempt to stick to [Semantic Versioning](http://semver.org/). Most of the time, development should be against a new minor version - fixing bugs and adding new features that are backwards compatible.
17 |
18 | The current version lives in the file `/package.json`. This file should be set to the version that is _currently_ under development. That is, if version 1.0.0 is the current release then version should be incremented say, to 1.1.0.
19 |
20 | This version is used by both `jasmine.js` and the `jasmine-core` Ruby gem.
21 |
22 | Note that Jasmine should *not* use the "patch" version number. Let downstream projects rev their patch versions as needed, keeping their major and minor version numbers in sync with Jasmine core.
23 |
24 | ## Release
25 |
26 | When ready to release - specs are all green and the stories are done:
27 |
28 | 1. Update the release notes in `release_notes` - use the Anchorman gem to generate the markdown file and edit accordingly
29 | 1. Update the version in `package.json` to a release candidate
30 | 1. Update any links or top-level landing page for the Github Pages
31 |
32 | ### Build standalone distribution
33 |
34 | 1. Build the standalone distribution with `grunt buildStandaloneDist`
35 | 1. Make sure you add the new ZIP file to git
36 | 1. Should we still do this? Given we want to use guthub releases...
37 |
38 | ### Release the Python egg
39 |
40 | 1. `python setup.py register sdist upload` You will need pypi credentials to upload the egg.
41 |
42 | ### Release the Ruby gem
43 |
44 | 1. Copy version to the Ruby gem with `grunt build:copyVersionToGem`
45 | 1. __NOTE__: You will likely need to point to a local jasmine gem in order to run tests locally. _Do not_ push this version of the Gemfile.
46 | 1. __NOTE__: You will likely need to push a new jasmine gem with a dependent version right after this release.
47 | 1. Push these changes to GitHub and verify that this SHA is green
48 | 1. `rake release` - tags the repo with the version, builds the `jasmine-core` gem, pushes the gem to Rubygems.org. In order to release you will have to ensure you have rubygems creds locally.
49 |
50 | ### Release the NPM
51 |
52 | 1. `npm adduser` to save your credentials locally
53 | 1. `npm publish .` to publish what's in `package.json`
54 |
55 | ### Finally
56 |
57 | 1. Visit the [Releases page for Jasmine](https://github.com/pivotal/jasmine/releases), find the tag just pushed.
58 | 1. Paste in a link to the correct release notes for this release. The link should reference the blob and tag correctly, and the markdown file for the notes.
59 | 1. If it is a pre-release, mark it as such.
60 | 1. Attach the standalone zipfile
61 |
62 |
63 | There should be a post to Pivotal Labs blog and a tweet to that link.
64 |
--------------------------------------------------------------------------------
/lib/jasmine/src/core/base.js:
--------------------------------------------------------------------------------
1 | getJasmineRequireObj().base = (function (jasmineGlobal) {
2 | if (typeof module !== 'undefined' && module.exports) {
3 | jasmineGlobal = global;
4 | }
5 |
6 | return function(j$) {
7 | j$.unimplementedMethod_ = function() {
8 | throw new Error('unimplemented method');
9 | };
10 |
11 | j$.MAX_PRETTY_PRINT_DEPTH = 40;
12 | j$.MAX_PRETTY_PRINT_ARRAY_LENGTH = 100;
13 | j$.DEFAULT_TIMEOUT_INTERVAL = 5000;
14 |
15 | j$.getGlobal = function() {
16 | return jasmineGlobal;
17 | };
18 |
19 | j$.getEnv = function(options) {
20 | var env = j$.currentEnv_ = j$.currentEnv_ || new j$.Env(options);
21 | //jasmine. singletons in here (setTimeout blah blah).
22 | return env;
23 | };
24 |
25 | j$.isArray_ = function(value) {
26 | return j$.isA_('Array', value);
27 | };
28 |
29 | j$.isString_ = function(value) {
30 | return j$.isA_('String', value);
31 | };
32 |
33 | j$.isNumber_ = function(value) {
34 | return j$.isA_('Number', value);
35 | };
36 |
37 | j$.isA_ = function(typeName, value) {
38 | return Object.prototype.toString.apply(value) === '[object ' + typeName + ']';
39 | };
40 |
41 | j$.isDomNode = function(obj) {
42 | return obj.nodeType > 0;
43 | };
44 |
45 | j$.any = function(clazz) {
46 | return new j$.Any(clazz);
47 | };
48 |
49 | j$.objectContaining = function(sample) {
50 | return new j$.ObjectContaining(sample);
51 | };
52 |
53 | j$.createSpy = function(name, originalFn) {
54 |
55 | var spyStrategy = new j$.SpyStrategy({
56 | name: name,
57 | fn: originalFn,
58 | getSpy: function() { return spy; }
59 | }),
60 | callTracker = new j$.CallTracker(),
61 | spy = function() {
62 | callTracker.track({
63 | object: this,
64 | args: Array.prototype.slice.apply(arguments)
65 | });
66 | return spyStrategy.exec.apply(this, arguments);
67 | };
68 |
69 | for (var prop in originalFn) {
70 | if (prop === 'and' || prop === 'calls') {
71 | throw new Error('Jasmine spies would overwrite the \'and\' and \'calls\' properties on the object being spied upon');
72 | }
73 |
74 | spy[prop] = originalFn[prop];
75 | }
76 |
77 | spy.and = spyStrategy;
78 | spy.calls = callTracker;
79 |
80 | return spy;
81 | };
82 |
83 | j$.isSpy = function(putativeSpy) {
84 | if (!putativeSpy) {
85 | return false;
86 | }
87 | return putativeSpy.and instanceof j$.SpyStrategy &&
88 | putativeSpy.calls instanceof j$.CallTracker;
89 | };
90 |
91 | j$.createSpyObj = function(baseName, methodNames) {
92 | if (!j$.isArray_(methodNames) || methodNames.length === 0) {
93 | throw 'createSpyObj requires a non-empty array of method names to create spies for';
94 | }
95 | var obj = {};
96 | for (var i = 0; i < methodNames.length; i++) {
97 | obj[methodNames[i]] = j$.createSpy(baseName + '.' + methodNames[i]);
98 | }
99 | return obj;
100 | };
101 | };
102 | })(this);
103 |
--------------------------------------------------------------------------------
/src/bootstrap-tagsinput-angular.js:
--------------------------------------------------------------------------------
1 | angular.module('bootstrap-tagsinput', [])
2 | .directive('bootstrapTagsinput', [function() {
3 |
4 | function getItemProperty(scope, property) {
5 | if (!property)
6 | return undefined;
7 |
8 | if (angular.isFunction(scope.$parent[property]))
9 | return scope.$parent[property];
10 |
11 | return function(item) {
12 | return item[property];
13 | };
14 | }
15 |
16 | return {
17 | restrict: 'EA',
18 | scope: {
19 | model: '=ngModel'
20 | },
21 | template: '',
22 | replace: false,
23 | link: function(scope, element, attrs) {
24 | $(function() {
25 | if (!angular.isArray(scope.model))
26 | scope.model = [];
27 |
28 | var select = $('select', element);
29 | var typeaheadSourceArray = attrs.typeaheadSource ? attrs.typeaheadSource.split('.') : null;
30 | var typeaheadSource = typeaheadSourceArray ?
31 | (typeaheadSourceArray.length > 1 ?
32 | scope.$parent[typeaheadSourceArray[0]][typeaheadSourceArray[1]]
33 | : scope.$parent[typeaheadSourceArray[0]])
34 | : null;
35 |
36 | select.tagsinput(scope.$parent[attrs.options || ''] || {
37 | typeahead : {
38 | source : angular.isFunction(typeaheadSource) ? typeaheadSource : null
39 | },
40 | itemValue: getItemProperty(scope, attrs.itemvalue),
41 | itemText : getItemProperty(scope, attrs.itemtext),
42 | confirmKeys : getItemProperty(scope, attrs.confirmkeys) ? JSON.parse(attrs.confirmkeys) : [13],
43 | tagClass : angular.isFunction(scope.$parent[attrs.tagclass]) ? scope.$parent[attrs.tagclass] : function(item) { return attrs.tagclass; }
44 | });
45 |
46 | for (var i = 0; i < scope.model.length; i++) {
47 | select.tagsinput('add', scope.model[i]);
48 | }
49 |
50 | select.on('itemAdded', function(event) {
51 | if (scope.model.indexOf(event.item) === -1)
52 | scope.model.push(event.item);
53 | });
54 |
55 | select.on('itemRemoved', function(event) {
56 | var idx = scope.model.indexOf(event.item);
57 | if (idx !== -1)
58 | scope.model.splice(idx, 1);
59 | });
60 |
61 | // create a shallow copy of model's current state, needed to determine
62 | // diff when model changes
63 | var prev = scope.model.slice();
64 | scope.$watch("model", function() {
65 | var added = scope.model.filter(function(i) {return prev.indexOf(i) === -1;}),
66 | removed = prev.filter(function(i) {return scope.model.indexOf(i) === -1;}),
67 | i;
68 |
69 | prev = scope.model.slice();
70 |
71 | // Remove tags no longer in binded model
72 | for (i = 0; i < removed.length; i++) {
73 | select.tagsinput('remove', removed[i]);
74 | }
75 |
76 | // Refresh remaining tags
77 | select.tagsinput('refresh');
78 |
79 | // Add new items in model as tags
80 | for (i = 0; i < added.length; i++) {
81 | select.tagsinput('add', added[i]);
82 | }
83 | }, true);
84 | });
85 | }
86 | };
87 | }]);
88 |
--------------------------------------------------------------------------------
/lib/jasmine/spec/core/matchers/toThrowSpec.js:
--------------------------------------------------------------------------------
1 | describe("toThrow", function() {
2 | it("throws an error when the actual is not a function", function() {
3 | var matcher = j$.matchers.toThrow();
4 |
5 | expect(function() {
6 | matcher.compare({});
7 | matcherComparator({});
8 | }).toThrowError("Actual is not a Function");
9 | });
10 |
11 | it("fails if actual does not throw", function() {
12 | var matcher = j$.matchers.toThrow(),
13 | fn = function() {
14 | return true;
15 | },
16 | result;
17 |
18 | result = matcher.compare(fn);
19 |
20 | expect(result.pass).toBe(false);
21 | expect(result.message).toEqual("Expected function to throw an exception.");
22 | });
23 |
24 | it("passes if it throws but there is no expected", function() {
25 | var util = {
26 | equals: jasmine.createSpy('delegated-equal').and.returnValue(true)
27 | },
28 | matcher = j$.matchers.toThrow(util),
29 | fn = function() {
30 | throw 5;
31 | },
32 | result;
33 |
34 | result = matcher.compare(fn);
35 |
36 | expect(result.pass).toBe(true);
37 | expect(result.message()).toEqual("Expected function not to throw, but it threw 5.");
38 | });
39 |
40 | it("passes even if what is thrown is falsy", function() {
41 | var matcher = j$.matchers.toThrow(),
42 | fn = function() {
43 | throw undefined;
44 | },
45 | result;
46 |
47 | result = matcher.compare(fn);
48 | expect(result.pass).toBe(true);
49 | expect(result.message()).toEqual("Expected function not to throw, but it threw undefined.");
50 | });
51 |
52 | it("passes if what is thrown is equivalent to what is expected", function() {
53 | var util = {
54 | equals: jasmine.createSpy('delegated-equal').and.returnValue(true)
55 | },
56 | matcher = j$.matchers.toThrow(util),
57 | fn = function() {
58 | throw 5;
59 | },
60 | result;
61 |
62 | result = matcher.compare(fn, 5);
63 |
64 | expect(result.pass).toBe(true);
65 | expect(result.message()).toEqual("Expected function not to throw 5.");
66 | });
67 |
68 | it("fails if what is thrown is not equivalent to what is expected", function() {
69 | var util = {
70 | equals: jasmine.createSpy('delegated-equal').and.returnValue(false)
71 | },
72 | matcher = j$.matchers.toThrow(util),
73 | fn = function() {
74 | throw 5;
75 | },
76 | result;
77 |
78 | result = matcher.compare(fn, "foo");
79 |
80 | expect(result.pass).toBe(false);
81 | expect(result.message()).toEqual("Expected function to throw 'foo', but it threw 5.");
82 | });
83 |
84 | it("fails if what is thrown is not equivalent to undefined", function() {
85 | var util = {
86 | equals: jasmine.createSpy('delegated-equal').and.returnValue(false)
87 | },
88 | matcher = j$.matchers.toThrow(util),
89 | fn = function() {
90 | throw 5;
91 | },
92 | result;
93 |
94 | result = matcher.compare(fn, void 0);
95 |
96 | expect(result.pass).toBe(false);
97 | expect(result.message()).toEqual("Expected function to throw undefined, but it threw 5.");
98 | });
99 | });
100 |
--------------------------------------------------------------------------------
/dist/bootstrap-tagsinput-angular.js:
--------------------------------------------------------------------------------
1 | /*
2 | * bootstrap-tagsinput v0.8.0
3 | *
4 | */
5 |
6 | angular.module('bootstrap-tagsinput', [])
7 | .directive('bootstrapTagsinput', [function() {
8 |
9 | function getItemProperty(scope, property) {
10 | if (!property)
11 | return undefined;
12 |
13 | if (angular.isFunction(scope.$parent[property]))
14 | return scope.$parent[property];
15 |
16 | return function(item) {
17 | return item[property];
18 | };
19 | }
20 |
21 | return {
22 | restrict: 'EA',
23 | scope: {
24 | model: '=ngModel'
25 | },
26 | template: '',
27 | replace: false,
28 | link: function(scope, element, attrs) {
29 | $(function() {
30 | if (!angular.isArray(scope.model))
31 | scope.model = [];
32 |
33 | var select = $('select', element);
34 | var typeaheadSourceArray = attrs.typeaheadSource ? attrs.typeaheadSource.split('.') : null;
35 | var typeaheadSource = typeaheadSourceArray ?
36 | (typeaheadSourceArray.length > 1 ?
37 | scope.$parent[typeaheadSourceArray[0]][typeaheadSourceArray[1]]
38 | : scope.$parent[typeaheadSourceArray[0]])
39 | : null;
40 |
41 | select.tagsinput(scope.$parent[attrs.options || ''] || {
42 | typeahead : {
43 | source : angular.isFunction(typeaheadSource) ? typeaheadSource : null
44 | },
45 | itemValue: getItemProperty(scope, attrs.itemvalue),
46 | itemText : getItemProperty(scope, attrs.itemtext),
47 | confirmKeys : getItemProperty(scope, attrs.confirmkeys) ? JSON.parse(attrs.confirmkeys) : [13],
48 | tagClass : angular.isFunction(scope.$parent[attrs.tagclass]) ? scope.$parent[attrs.tagclass] : function(item) { return attrs.tagclass; }
49 | });
50 |
51 | for (var i = 0; i < scope.model.length; i++) {
52 | select.tagsinput('add', scope.model[i]);
53 | }
54 |
55 | select.on('itemAdded', function(event) {
56 | if (scope.model.indexOf(event.item) === -1)
57 | scope.model.push(event.item);
58 | });
59 |
60 | select.on('itemRemoved', function(event) {
61 | var idx = scope.model.indexOf(event.item);
62 | if (idx !== -1)
63 | scope.model.splice(idx, 1);
64 | });
65 |
66 | // create a shallow copy of model's current state, needed to determine
67 | // diff when model changes
68 | var prev = scope.model.slice();
69 | scope.$watch("model", function() {
70 | var added = scope.model.filter(function(i) {return prev.indexOf(i) === -1;}),
71 | removed = prev.filter(function(i) {return scope.model.indexOf(i) === -1;}),
72 | i;
73 |
74 | prev = scope.model.slice();
75 |
76 | // Remove tags no longer in binded model
77 | for (i = 0; i < removed.length; i++) {
78 | select.tagsinput('remove', removed[i]);
79 | }
80 |
81 | // Refresh remaining tags
82 | select.tagsinput('refresh');
83 |
84 | // Add new items in model as tags
85 | for (i = 0; i < added.length; i++) {
86 | select.tagsinput('add', added[i]);
87 | }
88 | }, true);
89 | });
90 | }
91 | };
92 | }]);
93 |
--------------------------------------------------------------------------------
/lib/jasmine/README.md:
--------------------------------------------------------------------------------
1 | [
](http://jasmine.github.io)
2 |
3 | [](https://travis-ci.org/pivotal/jasmine) [](https://codeclimate.com/github/pivotal/jasmine)
4 |
5 | =======
6 |
7 | **A JavaScript Testing Framework**
8 |
9 | Jasmine is a Behavior Driven Development testing framework for JavaScript. It does not rely on browsers, DOM, or any JavaScript framework. Thus it's suited for websites, [Node.js](http://nodejs.org) projects, or anywhere that JavaScript can run.
10 |
11 | Documentation & guides live here: [http://jasmine.github.io](http://jasmine.github.io/)
12 | For a quick start guide of Jasmine 2.0, see the beginning of [http://jasmine.github.io/2.0/introduction.html](http://jasmine.github.io/2.0/introduction.html)
13 |
14 | Upgrading from Jasmine 1.x? Check out the [2.0 release notes](https://github.com/pivotal/jasmine/blob/v2.0.0/release_notes/20.md) for a list of what's new (including breaking interface changes).
15 |
16 | ## Contributing
17 |
18 | Please read the [contributors' guide](https://github.com/pivotal/jasmine/blob/master/CONTRIBUTING.md)
19 |
20 | ## Installation
21 |
22 | To install Jasmine on your local box:
23 |
24 | * Clone Jasmine - `git clone https://github.com/pivotal/jasmine.git`
25 | * Create a Jasmine directory in your project - `mkdir my-project/jasmine`
26 | * Move latest dist to your project directory - `mv jasmine/dist/jasmine-standalone-2.0.0.zip my-project/jasmine`
27 | * Change directory - `cd my-project/jasmine`
28 | * Unzip the dist - `unzip jasmine-standalone-2.0.0.zip`
29 |
30 | Add the following to your HTML file:
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 | For the Jasmine Ruby Gem:
40 | [https://github.com/pivotal/jasmine-gem](https://github.com/pivotal/jasmine-gem)
41 |
42 | For the Jasmine Python Egg:
43 | [https://github.com/pivotal/jasmine-py](https://github.com/pivotal/jasmine-py)
44 |
45 |
46 |
47 | ## Support
48 |
49 | * Search past discussions: [http://groups.google.com/group/jasmine-js](http://groups.google.com/group/jasmine-js)
50 | * Send an email to the list: [jasmine-js@googlegroups.com](mailto:jasmine-js@googlegroups.com)
51 | * View the project backlog at Pivotal Tracker: [http://www.pivotaltracker.com/projects/10606](http://www.pivotaltracker.com/projects/10606)
52 | * Follow us on Twitter: [@JasmineBDD](http://twitter.com/JasmineBDD)
53 |
54 | ## Maintainers
55 |
56 | * [Davis W. Frank](mailto:dwfrank@pivotallabs.com), Pivotal Labs
57 | * [Rajan Agaskar](mailto:rajan@pivotallabs.com), Pivotal Labs
58 | * [Sheel Choksi](mailto:schoksi@pivotallabs.com), Pivotal Labs
59 |
60 | ### Maintainers Emeritus
61 |
62 | * [Christian Williams](mailto:antixian666@gmail.com), Square
63 |
64 | Copyright (c) 2008-2014 Pivotal Labs. This software is licensed under the MIT License.
65 |
--------------------------------------------------------------------------------
/examples/assets/app_bs2.js:
--------------------------------------------------------------------------------
1 | $('.example_typeahead > > input').tagsinput({
2 | typeahead: {
3 | source: function(query) {
4 | return $.getJSON('assets/citynames.json');
5 | }
6 | }
7 | });
8 |
9 | $('.example_objects_as_tags > > input').tagsinput({
10 | itemValue: 'value',
11 | itemText: 'text',
12 | typeahead: {
13 | source: function(query) {
14 | return $.getJSON('assets/cities.json');
15 | }
16 | }
17 | });
18 | $('.example_objects_as_tags > > input').tagsinput('add', { "value": 1 , "text": "Amsterdam" , "continent": "Europe" });
19 | $('.example_objects_as_tags > > input').tagsinput('add', { "value": 4 , "text": "Washington" , "continent": "America" });
20 | $('.example_objects_as_tags > > input').tagsinput('add', { "value": 7 , "text": "Sydney" , "continent": "Australia" });
21 | $('.example_objects_as_tags > > input').tagsinput('add', { "value": 10, "text": "Beijing" , "continent": "Asia" });
22 | $('.example_objects_as_tags > > input').tagsinput('add', { "value": 13, "text": "Cairo" , "continent": "Africa" });
23 |
24 | $('.example_tagclass > > input').tagsinput({
25 | tagClass: function(item) {
26 | switch (item.continent) {
27 | case 'Europe' : return 'label label-info';
28 | case 'America' : return 'label label-danger label-important';
29 | case 'Australia': return 'label label-success';
30 | case 'Africa' : return 'label';
31 | case 'Asia' : return 'label label-warning';
32 | }
33 | },
34 | itemValue: 'value',
35 | itemText: 'text',
36 | typeahead: {
37 | source: function(query) {
38 | return $.getJSON('assets/cities.json');
39 | }
40 | }
41 | });
42 | $('.example_tagclass > > input').tagsinput('add', { "value": 1 , "text": "Amsterdam" , "continent": "Europe" });
43 | $('.example_tagclass > > input').tagsinput('add', { "value": 4 , "text": "Washington" , "continent": "America" });
44 | $('.example_tagclass > > input').tagsinput('add', { "value": 7 , "text": "Sydney" , "continent": "Australia" });
45 | $('.example_tagclass > > input').tagsinput('add', { "value": 10, "text": "Beijing" , "continent": "Asia" });
46 | $('.example_tagclass > > input').tagsinput('add', { "value": 13, "text": "Cairo" , "continent": "Africa" });
47 |
48 | angular.module('AngularExample', ['bootstrap-tagsinput'])
49 | .controller('CityTagsInputController',
50 | function CityTagsInputController($scope, $http) {
51 | // Init with some cities
52 | $scope.cities = [
53 | { "value": 1 , "text": "Amsterdam" , "continent": "Europe" },
54 | { "value": 4 , "text": "Washington" , "continent": "America" },
55 | { "value": 7 , "text": "Sydney" , "continent": "Australia" },
56 | { "value": 10, "text": "Beijing" , "continent": "Asia" },
57 | { "value": 13, "text": "Cairo" , "continent": "Africa" }
58 | ];
59 |
60 | $scope.queryCities = function(query) {
61 | return $http.get('assets/cities.json');
62 | };
63 |
64 | $scope.getTagClass = function(city) {
65 | switch (city.continent) {
66 | case 'Europe' : return 'label label-info';
67 | case 'America' : return 'label label-danger label-important';
68 | case 'Australia': return 'label label-success';
69 | case 'Africa' : return 'label';
70 | case 'Asia' : return 'label label-warning';
71 | }
72 | };
73 | }
74 | );
--------------------------------------------------------------------------------
/lib/jasmine/src/core/Expectation.js:
--------------------------------------------------------------------------------
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 | };
108 |
--------------------------------------------------------------------------------
/lib/jasmine/spec/core/CallTrackerSpec.js:
--------------------------------------------------------------------------------
1 | describe("CallTracker", function() {
2 | it("tracks that it was called when executed", function() {
3 | var callTracker = new j$.CallTracker();
4 |
5 | expect(callTracker.any()).toBe(false);
6 |
7 | callTracker.track();
8 |
9 | expect(callTracker.any()).toBe(true);
10 | });
11 |
12 | it("tracks that number of times that it is executed", function() {
13 | var callTracker = new j$.CallTracker();
14 |
15 | expect(callTracker.count()).toEqual(0);
16 |
17 | callTracker.track();
18 |
19 | expect(callTracker.count()).toEqual(1);
20 | });
21 |
22 | it("tracks the params from each execution", function() {
23 | var callTracker = new j$.CallTracker();
24 |
25 | callTracker.track({object: void 0, args: []});
26 | callTracker.track({object: {}, args: [0, "foo"]});
27 |
28 | expect(callTracker.argsFor(0)).toEqual([]);
29 |
30 | expect(callTracker.argsFor(1)).toEqual([0, "foo"]);
31 | });
32 |
33 | it("returns any empty array when there was no call", function() {
34 | var callTracker = new j$.CallTracker();
35 |
36 | expect(callTracker.argsFor(0)).toEqual([]);
37 | });
38 |
39 | it("allows access for the arguments for all calls", function() {
40 | var callTracker = new j$.CallTracker();
41 |
42 | callTracker.track({object: {}, args: []});
43 | callTracker.track({object: {}, args: [0, "foo"]});
44 |
45 | expect(callTracker.allArgs()).toEqual([[], [0, "foo"]]);
46 | });
47 |
48 | it("tracks the context and arguments for each call", function() {
49 | var callTracker = new j$.CallTracker();
50 |
51 | callTracker.track({object: {}, args: []});
52 | callTracker.track({object: {}, args: [0, "foo"]});
53 |
54 | expect(callTracker.all()[0]).toEqual({object: {}, args: []});
55 |
56 | expect(callTracker.all()[1]).toEqual({object: {}, args: [0, "foo"]});
57 | });
58 |
59 | it("simplifies access to the arguments for the last (most recent) call", function() {
60 | var callTracker = new j$.CallTracker();
61 |
62 | callTracker.track();
63 | callTracker.track({object: {}, args: [0, "foo"]});
64 |
65 | expect(callTracker.mostRecent()).toEqual({
66 | object: {},
67 | args: [0, "foo"]
68 | });
69 | });
70 |
71 | it("returns a useful falsy value when there isn't a last (most recent) call", function() {
72 | var callTracker = new j$.CallTracker();
73 |
74 | expect(callTracker.mostRecent()).toBeFalsy();
75 | });
76 |
77 | it("simplifies access to the arguments for the first (oldest) call", function() {
78 | var callTracker = new j$.CallTracker();
79 |
80 | callTracker.track({object: {}, args: [0, "foo"]});
81 |
82 | expect(callTracker.first()).toEqual({object: {}, args: [0, "foo"]})
83 | });
84 |
85 | it("returns a useful falsy value when there isn't a first (oldest) call", function() {
86 | var callTracker = new j$.CallTracker();
87 |
88 | expect(callTracker.first()).toBeFalsy();
89 | });
90 |
91 |
92 | it("allows the tracking to be reset", function() {
93 | var callTracker = new j$.CallTracker();
94 |
95 | callTracker.track();
96 | callTracker.track({object: {}, args: [0, "foo"]});
97 | callTracker.reset();
98 |
99 | expect(callTracker.any()).toBe(false);
100 | expect(callTracker.count()).toEqual(0);
101 | expect(callTracker.argsFor(0)).toEqual([]);
102 | expect(callTracker.all()).toEqual([]);
103 | expect(callTracker.mostRecent()).toBeFalsy();
104 | });
105 | });
106 |
--------------------------------------------------------------------------------
/lib/jasmine/src/console/ConsoleReporter.js:
--------------------------------------------------------------------------------
1 | getJasmineRequireObj().ConsoleReporter = function() {
2 |
3 | var noopTimer = {
4 | start: function(){},
5 | elapsed: function(){ return 0; }
6 | };
7 |
8 | function ConsoleReporter(options) {
9 | var print = options.print,
10 | showColors = options.showColors || false,
11 | onComplete = options.onComplete || function() {},
12 | timer = options.timer || noopTimer,
13 | specCount,
14 | failureCount,
15 | failedSpecs = [],
16 | pendingCount,
17 | ansi = {
18 | green: '\x1B[32m',
19 | red: '\x1B[31m',
20 | yellow: '\x1B[33m',
21 | none: '\x1B[0m'
22 | };
23 |
24 | this.jasmineStarted = function() {
25 | specCount = 0;
26 | failureCount = 0;
27 | pendingCount = 0;
28 | print('Started');
29 | printNewline();
30 | timer.start();
31 | };
32 |
33 | this.jasmineDone = function() {
34 | printNewline();
35 | for (var i = 0; i < failedSpecs.length; i++) {
36 | specFailureDetails(failedSpecs[i]);
37 | }
38 |
39 | if(specCount > 0) {
40 | printNewline();
41 |
42 | var specCounts = specCount + ' ' + plural('spec', specCount) + ', ' +
43 | failureCount + ' ' + plural('failure', failureCount);
44 |
45 | if (pendingCount) {
46 | specCounts += ', ' + pendingCount + ' pending ' + plural('spec', pendingCount);
47 | }
48 |
49 | print(specCounts);
50 | } else {
51 | print('No specs found');
52 | }
53 |
54 | printNewline();
55 | var seconds = timer.elapsed() / 1000;
56 | print('Finished in ' + seconds + ' ' + plural('second', seconds));
57 |
58 | printNewline();
59 |
60 | onComplete(failureCount === 0);
61 | };
62 |
63 | this.specDone = function(result) {
64 | specCount++;
65 |
66 | if (result.status == 'pending') {
67 | pendingCount++;
68 | print(colored('yellow', '*'));
69 | return;
70 | }
71 |
72 | if (result.status == 'passed') {
73 | print(colored('green', '.'));
74 | return;
75 | }
76 |
77 | if (result.status == 'failed') {
78 | failureCount++;
79 | failedSpecs.push(result);
80 | print(colored('red', 'F'));
81 | }
82 | };
83 |
84 | return this;
85 |
86 | function printNewline() {
87 | print('\n');
88 | }
89 |
90 | function colored(color, str) {
91 | return showColors ? (ansi[color] + str + ansi.none) : str;
92 | }
93 |
94 | function plural(str, count) {
95 | return count == 1 ? str : str + 's';
96 | }
97 |
98 | function repeat(thing, times) {
99 | var arr = [];
100 | for (var i = 0; i < times; i++) {
101 | arr.push(thing);
102 | }
103 | return arr;
104 | }
105 |
106 | function indent(str, spaces) {
107 | var lines = (str || '').split('\n');
108 | var newArr = [];
109 | for (var i = 0; i < lines.length; i++) {
110 | newArr.push(repeat(' ', spaces).join('') + lines[i]);
111 | }
112 | return newArr.join('\n');
113 | }
114 |
115 | function specFailureDetails(result) {
116 | printNewline();
117 | print(result.fullName);
118 |
119 | for (var i = 0; i < result.failedExpectations.length; i++) {
120 | var failedExpectation = result.failedExpectations[i];
121 | printNewline();
122 | print(indent(failedExpectation.message, 2));
123 | print(indent(failedExpectation.stack, 2));
124 | }
125 |
126 | printNewline();
127 | }
128 | }
129 |
130 | return ConsoleReporter;
131 | };
132 |
--------------------------------------------------------------------------------
/lib/jasmine/src/core/Clock.js:
--------------------------------------------------------------------------------
1 | getJasmineRequireObj().Clock = function() {
2 | function Clock(global, delayedFunctionScheduler, mockDate) {
3 | var self = this,
4 | realTimingFunctions = {
5 | setTimeout: global.setTimeout,
6 | clearTimeout: global.clearTimeout,
7 | setInterval: global.setInterval,
8 | clearInterval: global.clearInterval
9 | },
10 | fakeTimingFunctions = {
11 | setTimeout: setTimeout,
12 | clearTimeout: clearTimeout,
13 | setInterval: setInterval,
14 | clearInterval: clearInterval
15 | },
16 | installed = false,
17 | timer;
18 |
19 |
20 | self.install = function() {
21 | replace(global, fakeTimingFunctions);
22 | timer = fakeTimingFunctions;
23 | installed = true;
24 |
25 | return self;
26 | };
27 |
28 | self.uninstall = function() {
29 | delayedFunctionScheduler.reset();
30 | mockDate.uninstall();
31 | replace(global, realTimingFunctions);
32 |
33 | timer = realTimingFunctions;
34 | installed = false;
35 | };
36 |
37 | self.mockDate = function(initialDate) {
38 | mockDate.install(initialDate);
39 | };
40 |
41 | self.setTimeout = function(fn, delay, params) {
42 | if (legacyIE()) {
43 | if (arguments.length > 2) {
44 | throw new Error('IE < 9 cannot support extra params to setTimeout without a polyfill');
45 | }
46 | return timer.setTimeout(fn, delay);
47 | }
48 | return Function.prototype.apply.apply(timer.setTimeout, [global, arguments]);
49 | };
50 |
51 | self.setInterval = function(fn, delay, params) {
52 | if (legacyIE()) {
53 | if (arguments.length > 2) {
54 | throw new Error('IE < 9 cannot support extra params to setInterval without a polyfill');
55 | }
56 | return timer.setInterval(fn, delay);
57 | }
58 | return Function.prototype.apply.apply(timer.setInterval, [global, arguments]);
59 | };
60 |
61 | self.clearTimeout = function(id) {
62 | return Function.prototype.call.apply(timer.clearTimeout, [global, id]);
63 | };
64 |
65 | self.clearInterval = function(id) {
66 | return Function.prototype.call.apply(timer.clearInterval, [global, id]);
67 | };
68 |
69 | self.tick = function(millis) {
70 | if (installed) {
71 | mockDate.tick(millis);
72 | delayedFunctionScheduler.tick(millis);
73 | } else {
74 | throw new Error('Mock clock is not installed, use jasmine.clock().install()');
75 | }
76 | };
77 |
78 | return self;
79 |
80 | function legacyIE() {
81 | //if these methods are polyfilled, apply will be present
82 | return !(realTimingFunctions.setTimeout || realTimingFunctions.setInterval).apply;
83 | }
84 |
85 | function replace(dest, source) {
86 | for (var prop in source) {
87 | dest[prop] = source[prop];
88 | }
89 | }
90 |
91 | function setTimeout(fn, delay) {
92 | return delayedFunctionScheduler.scheduleFunction(fn, delay, argSlice(arguments, 2));
93 | }
94 |
95 | function clearTimeout(id) {
96 | return delayedFunctionScheduler.removeFunctionWithId(id);
97 | }
98 |
99 | function setInterval(fn, interval) {
100 | return delayedFunctionScheduler.scheduleFunction(fn, interval, argSlice(arguments, 2), true);
101 | }
102 |
103 | function clearInterval(id) {
104 | return delayedFunctionScheduler.removeFunctionWithId(id);
105 | }
106 |
107 | function argSlice(argsObj, n) {
108 | return Array.prototype.slice.call(argsObj, n);
109 | }
110 | }
111 |
112 | return Clock;
113 | };
114 |
--------------------------------------------------------------------------------
/lib/jasmine/src/core/Spec.js:
--------------------------------------------------------------------------------
1 | getJasmineRequireObj().Spec = function(j$) {
2 | function Spec(attrs) {
3 | this.expectationFactory = attrs.expectationFactory;
4 | this.resultCallback = attrs.resultCallback || function() {};
5 | this.id = attrs.id;
6 | this.description = attrs.description || '';
7 | this.fn = attrs.fn;
8 | this.beforeFns = attrs.beforeFns || function() { return []; };
9 | this.afterFns = attrs.afterFns || function() { return []; };
10 | this.onStart = attrs.onStart || function() {};
11 | this.exceptionFormatter = attrs.exceptionFormatter || function() {};
12 | this.getSpecName = attrs.getSpecName || function() { return ''; };
13 | this.expectationResultFactory = attrs.expectationResultFactory || function() { };
14 | this.queueRunnerFactory = attrs.queueRunnerFactory || function() {};
15 | this.catchingExceptions = attrs.catchingExceptions || function() { return true; };
16 |
17 | if (!this.fn) {
18 | this.pend();
19 | }
20 |
21 | this.result = {
22 | id: this.id,
23 | description: this.description,
24 | fullName: this.getFullName(),
25 | failedExpectations: [],
26 | passedExpectations: []
27 | };
28 | }
29 |
30 | Spec.prototype.addExpectationResult = function(passed, data) {
31 | var expectationResult = this.expectationResultFactory(data);
32 | if (passed) {
33 | this.result.passedExpectations.push(expectationResult);
34 | } else {
35 | this.result.failedExpectations.push(expectationResult);
36 | }
37 | };
38 |
39 | Spec.prototype.expect = function(actual) {
40 | return this.expectationFactory(actual, this);
41 | };
42 |
43 | Spec.prototype.execute = function(onComplete) {
44 | var self = this;
45 |
46 | this.onStart(this);
47 |
48 | if (this.markedPending || this.disabled) {
49 | complete();
50 | return;
51 | }
52 |
53 | var allFns = this.beforeFns().concat(this.fn).concat(this.afterFns());
54 |
55 | this.queueRunnerFactory({
56 | fns: allFns,
57 | onException: onException,
58 | onComplete: complete,
59 | enforceTimeout: function() { return true; }
60 | });
61 |
62 | function onException(e) {
63 | if (Spec.isPendingSpecException(e)) {
64 | self.pend();
65 | return;
66 | }
67 |
68 | self.addExpectationResult(false, {
69 | matcherName: '',
70 | passed: false,
71 | expected: '',
72 | actual: '',
73 | error: e
74 | });
75 | }
76 |
77 | function complete() {
78 | self.result.status = self.status();
79 | self.resultCallback(self.result);
80 |
81 | if (onComplete) {
82 | onComplete();
83 | }
84 | }
85 | };
86 |
87 | Spec.prototype.disable = function() {
88 | this.disabled = true;
89 | };
90 |
91 | Spec.prototype.pend = function() {
92 | this.markedPending = true;
93 | };
94 |
95 | Spec.prototype.status = function() {
96 | if (this.disabled) {
97 | return 'disabled';
98 | }
99 |
100 | if (this.markedPending) {
101 | return 'pending';
102 | }
103 |
104 | if (this.result.failedExpectations.length > 0) {
105 | return 'failed';
106 | } else {
107 | return 'passed';
108 | }
109 | };
110 |
111 | Spec.prototype.getFullName = function() {
112 | return this.getSpecName(this);
113 | };
114 |
115 | Spec.pendingSpecExceptionMessage = '=> marked Pending';
116 |
117 | Spec.isPendingSpecException = function(e) {
118 | return !!(e && e.toString && e.toString().indexOf(Spec.pendingSpecExceptionMessage) !== -1);
119 | };
120 |
121 | return Spec;
122 | };
123 |
124 | if (typeof window == void 0 && typeof exports == 'object') {
125 | exports.Spec = jasmineRequire.Spec;
126 | }
127 |
--------------------------------------------------------------------------------
/lib/jasmine/release_notes/2.0.1.md:
--------------------------------------------------------------------------------
1 | # Jasmine Core 2.0.1 Release Notes
2 |
3 | ## Summary
4 |
5 | This release is for small bug fixes and enhancements ahead of a real-soon-now 2.1.
6 |
7 | ## Changes
8 |
9 | ### Features
10 |
11 | * NodeJS is now supported with a jasmine-core npm
12 | * [Support browsers that don't supply a `Date.now()` by having a `mockDate` object](http://www.pivotaltracker.com/story/66606132) - Closes #361
13 | * [Show message if no specs where loaded](http://www.pivotaltracker.com/story/12784235)
14 | * When using `jasmine.any`, the `class` will now be included in the error message
15 | * Reporters now receive the number of passed expectations in a spec
16 | * Use default failure message for `toBeNaN`
17 | * Use the latest `jasmine_selenium_runner` so we use the fix for printing objects with cycles
18 | * Add jasmine logo image to HTML runner
19 | * Stop Jasmine's CSS affecting the style of the body tag - Closes #600
20 | * Standardized location of the standalone distributions - they now live in the repo in `/dist` as well as on the Releases page
21 |
22 | ### Bugs
23 |
24 | * Don't allow calling the same done callback multiple times - Fixes #523
25 | * [Remove 'empty' as an option as a spec result](http://www.pivotaltracker.com/story/73741032) as this was a breaking change
26 | * Instead, we determine if a spec has no expectations using the added
27 | key of `passedExpectations` in combination of the `failedExpectations`
28 | to determine that there a spec is 'empty'
29 | * Fix build in IE8 (IE8 doesn't support `Object.freeze`)
30 | * Fix `ObjectContaining` to match recursively
31 |
32 | ### Documentation
33 |
34 | * Update release doc to use GitHub releases
35 | * Add installation instructions to README - Merges #621
36 | * Add Ruby Gem and Python Egg to docs
37 | * Add detailed steps on how to contribute - Merges #580 from @pablofiu
38 |
39 | ## Pull Requests and Issues
40 |
41 | * Contains is explicitly false if actual is `undefined` or `null` - Fixes #627
42 | * namespace `html-reporter` -> `jasmine_html-reporter` - Fixes #600
43 | * Throw a more specific error when `expect` is used without a `currentSpec` - Fixes #602
44 | * Reduced size of logo with PNG Gauntlet - Merges #588
45 | * HTML Reporter resets previous DOM when re-initialized - Merges #594 from @plukevdh
46 | * Narrow down raise exceptions query selector; Finding by any input tag is a little bit broad - Closes #605
47 | * Pass through custom equality testers in toHaveBeenCalledWith - Fixes #536
48 | * Fix outdated copyright year (update to 2014) - Merges #550 from @slothmonster
49 | * [Add package.json to Python egg to get correct version number](http://www.pivotaltracker.com/story/67556148) - Fixes #551
50 | * Allow users to set the maximum length of array that the pretty-printer
51 | will print out - Fixes #323 @mikemoraned and #374 @futuraprime
52 | * `matchersUtil.equals()` does not expect a matcher as its first argument,
53 | so send the "actual" value first and the "expected" value second. - Merges #538 from @cbandy
54 | * Add single quote check to `jshint` and fix src files for that - Closes #522
55 | * Remove an `eval` in order to support running jasmine within CSP - Closes #503
56 | * Allow matcher custom failure messages to be a function - Closes #520
57 | * More color blind friendly CSS from @dleppik - Closes #463 & #509
58 | * Use `load-grunt-tasks` Merges #521 from @robinboehm
59 | * Special case printing `-0` - Closes #496
60 | * Allow stub or spy Date object safely using a closure to get a clean copy - Closes #506
61 | * [Use `\d7` instead of plain 'x' for more square appearance](http://www.pivotaltracker.com/story/48434179)
62 | * Better support in pretty printer when an object has null prototype - Fixes #500
63 | * Update link at top of README to improve access to Jasmine 2.0 docs - Merges #486 from @nextmat
64 | * Force query selector to seek within the html-reporter element - Merges #479 from @shprink
65 | * Netbeans files are in gitignore - Merges #478 from @shprink
66 |
67 |
68 | ------
69 |
70 | _Release Notes generated with [Anchorman](http://github.com/infews/anchorman)_
71 |
--------------------------------------------------------------------------------