├── 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('", 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