Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Remove javascript (jasmine) tests

Moving them to travis-assets, which has the actual javascript files to be
tested.
  • Loading branch information...
commit c7f5b5369f7f431d5fa0509305c70283063b0f73 1 parent b89f93e
@henrikhodne henrikhodne authored
Showing with 1 addition and 5,434 deletions.
  1. +0 −2  .travis.yml
  2. +0 −1  Gemfile
  3. +0 −13 Gemfile.lock
  4. +1 −11 lib/tasks/ci.rake
  5. +0 −84 spec/javascripts/events_spec.js
  6. +0 −130 spec/javascripts/helpers/factories.js
  7. +0 −97 spec/javascripts/helpers/matchers.js
  8. +0 −160 spec/javascripts/helpers/matchers_travis.js
  9. +0 −67 spec/javascripts/helpers/spec_helper.js
  10. +0 −122 spec/javascripts/lib/deansi_spec.js
  11. +0 −41 spec/javascripts/lib/travis/datasource_spec.js
  12. +0 −46 spec/javascripts/lib/travis/log/filter_spec.js
  13. +0 −122 spec/javascripts/lib/travis/log/fold_pattern_spec.js
  14. +0 −230 spec/javascripts/lib/travis/log/incremental_spec.js
  15. +0 −82 spec/javascripts/lib/travis/query_spec.js
  16. +0 −51 spec/javascripts/lib/travis/record_spec.js
  17. +0 −124 spec/javascripts/models/build_spec.js
  18. +0 −165 spec/javascripts/models/job_spec.js
  19. +0 −164 spec/javascripts/models/repository_spec.js
  20. +0 −36 spec/javascripts/support/jasmine.yml
  21. +0 −50 spec/javascripts/support/jasmine_config.rb
  22. +0 −22 spec/javascripts/support/jasmine_reporter.js
  23. +0 −35 spec/javascripts/support/jasmine_runner.rb
  24. +0 −2,476 spec/javascripts/vendor/jasmine-1.1.0.js
  25. +0 −190 spec/javascripts/vendor/jasmine-html-1.1.0.js
  26. +0 −288 spec/javascripts/vendor/jasmine-jquery-1.3.1.js
  27. +0 −207 spec/javascripts/vendor/jasmine_ajax.js
  28. +0 −68 spec/javascripts/views/builds/list_spec.js
  29. +0 −75 spec/javascripts/views/builds/matrix_spec.js
  30. +0 −99 spec/javascripts/views/builds/show_spec.js
  31. +0 −38 spec/javascripts/views/jobs/list_spec.js
  32. +0 −31 spec/javascripts/views/queue/show_spec.js
  33. +0 −39 spec/javascripts/views/repositories/list_spec.js
  34. +0 −42 spec/javascripts/views/repositories/show_spec.js
  35. +0 −26 spec/javascripts/views/workers/list_spec.js
View
2  .travis.yml
@@ -4,8 +4,6 @@ rvm:
bundler_args: "--without development"
before_script:
- "cp config/database.example.yml config/database.yml"
- - "export DISPLAY=:99.0"
- - "sh -e /etc/init.d/xvfb start"
script: "RAILS_ENV=test bundle exec rake test:ci --trace"
notifications:
irc: "irc.freenode.org#travis"
View
1  Gemfile
@@ -62,7 +62,6 @@ group :development do
end
group :test do
- gem 'jasmine', git: 'git://github.com/pivotal/jasmine-gem', submodules: true
gem 'capybara', '~> 1.1.2'
gem 'database_cleaner', '~> 0.7.0'
gem 'mocha', '~> 0.10.0'
View
13 Gemfile.lock
@@ -6,17 +6,6 @@ GIT
json (~> 1.6.5)
GIT
- remote: git://github.com/pivotal/jasmine-gem
- revision: 1e075fbf5a69812fcc914c453f002ecf5bed38ab
- submodules: true
- specs:
- jasmine (1.2.0)
- jasmine-core (>= 1.2.0)
- rack (~> 1.0)
- rspec (>= 1.3.1)
- selenium-webdriver (>= 0.1.3)
-
-GIT
remote: git://github.com/rack/rack-contrib
revision: 451f029857d655c4a37012564eb49665d2f9313a
specs:
@@ -175,7 +164,6 @@ GEM
http_accept_language (1.0.2)
httpauth (0.1)
i18n (0.6.0)
- jasmine-core (1.2.0)
journey (1.0.3)
json (1.6.7)
kgio (2.7.4)
@@ -343,7 +331,6 @@ DEPENDENCIES
gh!
http_accept_language (~> 1.0.2)
hubble!
- jasmine!
json (~> 1.6.3)
lograge (~> 0.0.4)
mocha (~> 0.10.0)
View
12 lib/tasks/ci.rake
@@ -1,19 +1,9 @@
namespace :test do
desc 'a little shortcut for ci testing'
- task :ci => ['ci_env', 'db:drop', 'db:create', 'db:test:load', 'spec', 'jasmine_on_travis']
- task :jasmine => ['jasmine_on_travis']
+ task :ci => ['ci_env', 'db:drop', 'db:create', 'db:test:load', 'spec']
end
task :ci_env do
ENV['CI'] = 'true'
ENV['RAILS_ENV'] = 'test'
-end
-
-task :jasmine_on_travis => ['ci_env'] do
- require 'jasmine'
- load 'jasmine/tasks/jasmine.rake'
- puts "Starting to run jasmine:ci..."
- system("export DISPLAY=:99.0 && bundle exec rake jasmine:ci")
- stat = $?.exitstatus
- exit(stat)
end
View
84 spec/javascripts/events_spec.js
@@ -1,84 +0,0 @@
-var EVENTS = {
-
- 'job:log': { id: 9, _log: 'Foo.' },
-
- 'job:created': { id: 21, number: '1.2', repository: { slug: 'travis-ci/test-job' } },
-
- 'job:started': { id: 9 },
-
- 'job:finished': { id: 9 },
-
- 'build:started': { build: { id: 2, repository_id: 2, number: 11 }, repository: { id: 2, slug: 'travis-ci/travis-ci' } },
-
- 'build:finished': { build: { id: 2, repository_id: 2, number: 11, result: 1 }, repository: { id: 2, slug: 'travis-ci/travis-ci-changed' } }
-
-};
-
-describe('Events:', function() {
-
- var events = Travis.Controllers.Events.create();
- var queue;
-
- var receiveEvent = function(event, ix) {
- var data = EVENTS[$.compact([event, ix]).join(':')];
- data = JSON.parse(JSON.stringify(data)); // make sure we pass a clone
- Ember.run(function() { events.receive(event, data); });
- };
-
- describe('job Events', function() {
- it('appends log data to an existing jobs log', function() {
- var test = Test.Factory.Job.single();
- receiveEvent('job:log');
- expect(test.get('log')).toEqual('Done. Build script exited with: 0\nFoo.');
-
- });
-
- it('adds a job when a new job is created', function() {
- var test = Test.Factory.Job.single();
- current = Travis.Job.all().get('length')
- receiveEvent('job:created');
- expect(Travis.Job.all().get('length')).toEqual(current+1);
- });
-
- it('job gets marked as started when it is started', function() {
- var test = Test.Factory.Job.single();
- receiveEvent('job:started');
- expect(test.get('state')).toEqual('started');
- });
-
- it('job gets marked as finished when it is finished', function() {
- var test = Test.Factory.Job.single();
- receiveEvent('job:finished');
- expect(test.get('state')).toEqual('finished');
- });
- });
-
- describe('updateFrom', function() {
- it('creates and updates repositories and builds', function() {
-
- expect(Travis.Repository.all().get('length')).toEqual(0);
- expect(Travis.Build.all().get('length')).toEqual(0);
-
- receiveEvent('build:started');
- var def = EVENTS['build:started']
- //added
- expect(Travis.Repository.all().get('length')).toEqual(1);
- expect(Travis.Build.all().get('length')).toEqual(1);
-
- //accurate
- var build = Travis.store.find(Travis.Build,def.build.id)
- var repo = Travis.store.find(Travis.Repository, def.repository.id)
- expect(build.get('number')).toEqual(def.build.number);
- expect(repo.get('slug')).toEqual(def.repository.slug)
- expect(build.get('result')).toEqual(null);
-
- //updated
- receiveEvent('build:finished');
- def = EVENTS['build:finished']
- build = Travis.store.find(Travis.Build,def.build.id)
- expect(build.get('result')).toEqual(def.build.result);
-
- });
- });
-
-});
View
130 spec/javascripts/helpers/factories.js
@@ -1,130 +0,0 @@
-// TODO extract data and use recorded fixtures to ensure we're in sync with the app
-Test.Factory = {
- Repository: {
- travis: function() {
- Travis.store.loadRecord(Travis.Repository, {
- id: '1',
- slug: 'travis-ci/travis-ci',
- last_build_id: '1',
- last_build_number: '1',
- last_build_result: '0',
- last_build_started_at: '2011-01-01T01:00:10Z',
- last_build_finished_at: '2011-01-01T01:00:20Z',
- event_type: 'push'
- }, 1);
- return Travis.store.find(Travis.Repository, 1);
- },
- worker: function() {
- Travis.store.loadRecord(Travis.Repository, {
- id: '2',
- slug: 'travis-ci/travis-worker',
- last_build_id: '2',
- last_build_number: '2',
- last_build_result: '0',
- last_build_started_at: '2011-01-01T02:00:10Z',
- last_build_finished_at: '2011-01-01T02:00:20Z'
- }, 2);
- return Travis.store.find(Travis.Repository, 2);
- },
- cookbooks: function() {
- Travis.store.loadRecord(Travis.Repository, {
- id: '3',
- slug: 'travis-ci/travis-cookbooks',
- last_build_id: '3',
- last_build_number: '3',
- last_build_result: '0',
- last_build_started_at: '2011-01-01T03:00:10Z',
- last_build_finished_at: '2011-01-01T03:00:20Z'
- }, 3);
- return Travis.store.find(Travis.Repository, 3);
- },
- recent: function() {
- Test.Factory.Repository.travis();
- Test.Factory.Repository.worker();
- return Travis.Repository.recent();
- }
- },
- Build: {
- byRepository: function() {
- Test.Factory.Build.passing();
- return Test.Factory.Repository.travis().get('builds');
- },
- passing: function() {
- Test.Factory.Repository.travis();
- Travis.store.loadRecord(Travis.Build, {
- id: 1,
- repository_id: 1,
- number: '1',
- state: 'finished',
- result: 0,
- started_at: '2011-01-01T01:00:10Z',
- finished_at: '2011-01-01T01:00:20Z',
- config: {
- '.configured': 'true'
- },
- commit: '4d7621e08e1c34e94ad9',
- branch: 'master',
- message: 'correct rules',
- committed_at: '2011-01-01T01:00:00Z',
- committer_name: 'Josh Kalderimis',
- committer_email: 'josh.kalderimis@gmail.com',
- author_name: 'Alex P',
- author_email: 'alexp@coffeenco.de',
- compare_url: 'https://github.com/travis-ci/travis-ci/compare/fe64573...3d1e844',
- event_type: 'push',
- matrix: [
- {
- id: 2,
- repository_id: 1,
- number: '1.1',
- state: 'finished',
- result: 0,
- started_at: '2011-01-01T01:00:10Z',
- finished_at: '2011-01-01T01:00:20Z',
- config: {
- '.configured': 'true'
- },
- log: 'Done. Build script exited with: 0\n',
- parent_id: 123126,
- commit: '3d1e844a359459652268edeeb79ee59bd1709248',
- branch: 'master',
- message: 'correct the refraction redirect rules',
- committed_at: '2011-09-02T22:33:19Z',
- committer_name: 'Josh Kalderimis',
- committer_email: 'josh.kalderimis@gmail.com',
- author_name: 'Alex P',
- author_email: 'alexp@coffeenco.de',
- compare_url: 'https://github.com/travis-ci/travis-ci/compare/fe64573...3d1e844'
- }
- ]
- }, 1);
- return Travis.store.find(Travis.Build, 1);
- }
- },
- Job: {
- all: function() {
- Travis.store.loadRecord(Travis.Job, { id: 1, number: '', repository_id: 1 }, 1);
- Travis.store.loadRecord(Travis.Job, { id: 2, number: '', repository_id: 2 }, 2);
- Travis.store.loadRecord(Travis.Job, { id: 3, number: '1', repository_id: 1 }, 3);
- Travis.store.loadRecord(Travis.Job, { id: 4, number: '2', repository_id: 2 }, 4);
- Travis.store.loadRecord(Travis.Job, { id: 5, number: '1.1', repository_id: 1 }, 5);
- Travis.store.loadRecord(Travis.Job, { id: 6, number: '1.2', repository_id: 1 }, 6);
- Travis.store.loadRecord(Travis.Job, { id: 7, number: '2.1', repository_id: 2 }, 7);
- Travis.store.loadRecord(Travis.Job, { id: 8, number: '2.2', repository_id: 2 }, 8);
- return Travis.store.find(Travis.Job);
- },
- single : function() {
- Travis.store.loadRecord(Travis.Job, { id: 9, number: '1.9', repository_id: 1, started_at: '2011-01-01T01:00:10Z', finished_at: '2011-01-01T01:00:20Z', commit: '4d7621ea359459652268edeeb79ee59bd1709248', branch: 'master', log: 'Done. Build script exited with: 0\n', build_id: 1 }, 9);
- return Travis.store.find(Travis.Job, 9);
- }
- },
- Worker: {
- all: function() {
- Travis.store.loadRecord(Travis.Worker, { id: 'ruby1.worker.travis-ci.org:10000:ruby' }, 1);
- Travis.store.loadRecord(Travis.Worker, { id: 'ruby1.worker.travis-ci.org:10001:ruby' }, 2);
- Travis.store.loadRecord(Travis.Worker, { id: 'ruby2.worker.travis-ci.org:20000:ruby' }, 3);
- Travis.store.loadRecord(Travis.Worker, { id: 'ruby2.worker.travis-ci.org:20001:ruby' }, 4);
- return Travis.store.find(Travis.Worker);
- }
- }
-};
View
97 spec/javascripts/helpers/matchers.js
@@ -1,97 +0,0 @@
-beforeEach(function() {
- this.addMatchers({
- toMatch: function(pattern) {
- return this.actual.match(pattern);
- },
-
- toFind: function(selector) {
- this.actual = $(this.actual);
- return this.actual.find(selector).length != 0;
- },
-
- toHaveTexts: function(texts) {
- this.actual = $(this.actual);
- var errors = [];
- _.each(texts, function(text, selector) {
- var actual = $.trim($(this.actual).find(selector).text());
- if(!jasmine.doesMatchText(actual, text)) {
- errors.push('expected the element ' + selector + ' to have the text "' + text +'", but actually has: "' + actual + '".');
- }
- }.bind(this));
- this.message = function() { return errors.join("\n") };
- return errors.length == 0;
- },
-
- toHaveText: function(text) {
- this.actual = $(this.actual);
- var actual = $(this.actual).text().replace(/^\s*|\s(?=\s)|\s*$/g, '').trim();
- this.message = function() {
- return 'expected the element ' + this.actual.selector + ' to have the text "' + text +'", but actually has: "' + actual + '".';
- };
- return jasmine.doesMatchText(actual, text);
- },
-
- toHaveDomAttributes: function(attributes) {
- this.actual = $(this.actual);
- var errors = [];
- _.each(attributes, function(attributes, selector) {
- _.each(attributes, function(value, name) {
- var actual = $.trim($(this.actual).find(selector).attr(name));
- if(typeof actual == 'function' ? !actual.test(value) : actual != value) {
- errors.push('expected the element ' + selector + ' to have the attribute ' + name + '=' + value +', but actually has: "' + actual + '".');
- }
- }.bind(this));
- }.bind(this));
- this.message = function() { return errors.join("\n") };
- return errors.length == 0;
- },
-
- toMatchList: function(list) {
- var actual = $.map($('li', this.actual), function(li) { return $(li).text().replace(/\n/g, '').replace(/^\s*|\s(?=\s)|\s*$/g, '').trim(); });
- var result = Ember.compare(actual, list) == 0;
- if(!result) {
- this.message = function() { return "expected the list to equal \n " + Ember.inspect(list) + ",\n\n but was: \n " + Ember.inspect(actual) + "\n"; }
- }
- return result;
- },
-
- toMatchTable: function(table) {
- // table = $.clone(table);
-
- var actual = $(this.actual);
- var errors = [];
- var headers = table.shift();
-
- $.each(headers, function(ix, text) {
- var selector = 'thead th:nth-child(' + (ix + 1) + ')';
- var current = $.trim($(actual).find(selector).text());
- if(!jasmine.doesMatchText(current, text)) {
- errors.push('expected the header ' + ix + ' to have the text "' + text + '", but actually has: "' + actual + '".');
- }
- });
-
- $.each(table, function(row, cells) {
- $.each(cells, function(cell, text) {
- var selector = 'tbody tr:nth-child(' + (row + 1) + ') td:nth-child(' + (cell + 1) + ')';
- var current = actual.find(selector).text();
- if(!jasmine.doesMatchText(current, text)) {
- errors.push('expected the cell "' + headers[cell] + '" in row ' + row + ' to have the text "' + text + '", but actually has: "' + actual + '".');
- }
- });
- });
-
- this.message = function() { return errors.join("\n"); };
- return errors.length == 0;
- }
- });
-});
-
-jasmine.doesMatchText = function (lft, rgt) {
- if(lft == 'undefined') {
- return rgt === undefined;
- } else if(typeof rgt === 'function') {
- return rgt.test(lft);
- } else {
- return lft == rgt;
- }
-};
View
160 spec/javascripts/helpers/matchers_travis.js
@@ -1,160 +0,0 @@
-$.extend(jasmine, {
- matchValues: function(selector, expected, errors, context) {
- if(typeof expected === 'object') {
- $.each(expected, function(name, expected) {
- var actual = $(selector, context);
- actual = name == 'text' ? actual.text() : actual.attr(name);
- if(!jasmine.doesMatchText(actual, expected)) {
- errors.push('expected "' + context.selector + ' ' + selector + '" to have the attribute ' + name + ': "' + expected + '", but actually has: "' + actual + '".');
- }
- });
- } else {
- var actual = $(selector, context).text();
- if(!jasmine.doesMatchText(actual, expected)) {
- errors.push('expected "' + context.selector + ' ' + selector + '" to have the text "' + expected + '", but actually has: "' + actual + '".');
- }
- }
- },
-
- listsRepository: function(element, repository, errors) {
- element = $(element);
-
- var expected = {
- 'a:nth-child(1)': repository.get('slug'),
- 'a:nth-child(2)': { text: '#' + repository.get('last_build_number'), href: '#!/%@/builds/%@'.fmt(repository.get('slug'), repository.get('last_build_id')) },
- '.duration': { title: repository.get('last_build_started_at'), text: repository.get('formattedLastBuildDuration') },
- '.finished_at': { title: repository.get('last_build_finished_at'), text: repository.get('formattedLastBuildFinishedAt') }
- };
-
- $.each(expected, function(selector, value) {
- jasmine.matchValues(selector, value, errors, element);
- });
-
- if(repository.get('selected') && !$(element).hasClass('selected')) {
- errors.push('expected "' + element.selector + '" to be selected but it is not.');
- } else if(!repository.get('selected') && $(element).hasClass('selected')) {
- errors.push('expected "' + element.selector + '" not to be selected but it is.');
- }
-
- var color = repository.get('color');
- if(color && !$(element).hasClass(color)) {
- errors.push('expected "' + element.selector + '" to be ' + repository.color + ' but it is not.');
- } else if($.keys(repository).indexOf('color') == -1 && !repository.color && $.any(['red', 'green'], function(color) { return $(element).hasClass(color) })) {
- errors.push('expected "' + element.selector + '" not to have a color class but it has.');
- }
-
- return errors.length == 0;
- },
-
- showsRepository: function(element, repository, errors) {
- element = $(element);
-
- var expected = {
- 'h3 a': { href: 'http://github.com/' + repository.get('slug'), text: repository.get('slug') },
- '.github-stats .watchers': { href: 'http://github.com/' + repository.get('slug') + '/watchers' },
- '.github-stats .forks': { href: 'http://github.com/' + repository.get('slug') + '/network' }
- };
- $.each(expected, function(selector, text) {
- jasmine.matchValues(selector, text, errors, element);
- });
-
- return errors.length == 0;
- },
-
- showsBuildSummary: function(element, build, errors) {
- element = $(element);
-
- var commit = build.get('commit').slice(0, 7) + (build.get('branch') ? ' (%@)'.fmt(build.get('branch')) : '');
- var commitUrl = 'http://github.com/' + build.getPath('repository.slug') + '/commit/' + build.get('commit');
-
- var expected = {
- '.summary .number': build.get('number'),
- '.summary .commit-hash a': { text: commit, href: commitUrl },
- '.summary .committer a': { text: build.get('committer_name'), href: 'mailto:' + build.get('committer_email') },
- '.summary .author a': { text: build.get('author_name'), href: 'mailto:' + build.get('author_email') }
- // '.summary .duration': { title: build.get('duration'), text: build.get('formattedDuration') },
- // '.summary .finished_at': { title: build.get('finished_at'), text: build.get('formattedFinishedAt') },
- };
-
- $.each(expected, function(selector, text) {
- jasmine.matchValues(selector, text, errors, element);
- });
-
- // TODO after moving these to helpers it's hard to test this. maybe instead of adding helper methods to the view
- // rather use presenters? but how to wrap a RecordArray then?
- //
- // var color = build.get('color');
- // if(color && !$('.summary', element).closest('.build').hasClass(color)) {
- // errors.push('expected "' + element.selector + '" to be ' + color + ' but it is not.');
- // } else if(!color && $.any(['red', 'green'], function(color) { return $('.summary', element).closest('.build').hasClass(color) })) {
- // errors.push('expected "' + element.selector + '" not to have a color class but it has.');
- // }
-
- this.message = function() { return errors.join("\n"); };
- return errors.length == 0;
- },
-
- showsBuildLog: function(element, log, errors) {
- var actual = $(element).find('.log p').html();
- log = $(log).html();
- if(actual != log) {
- errors.push('expected "' + element.selector + '.log" to show the log "' + log + '", but it shows "' + actual + '".');
- }
- return errors.length == 0;
- },
-
- showsActiveTab: function(element, tab, errors) {
- element = $(element);
- if(!$('#tab_' + tab, element).hasClass('active')) {
- errors.push('expected the tab "' + tab + '" to be active, but it is not.');
- }
- return errors.length == 0;
- }
-});
-
-beforeEach(function() {
- this.addMatchers({
- toListRepositories: function(repositories) {
- var errors = [];
- this.message = function() { return errors.join("\n"); };
-
- var result = true;
- $.each(repositories.toArray(), function(ix, repository) {
- var element = $('.repository:nth-child(%@)'.fmt(ix + 1), this.actual);
- result &= jasmine.listsRepository(element, repository, errors);
- });
- return result;
- },
-
- toListRepository: function(repository) {
- var errors = [];
- this.message = function() { return errors.join("\n"); };
- return jasmine.listsRepository(this.actual, repository, errors);
- },
-
- toShowRepository: function(repository) {
- var errors = [];
- this.message = function() { return errors.join("\n"); };
- return jasmine.showsRepository(this.actual, repository, errors);
- },
-
- toShowBuildSummary: function(build) {
- var errors = [];
- this.message = function() { return errors.join("\n"); };
- return jasmine.showsBuildSummary(this.actual, build, errors);
- },
-
- toShowBuildLog: function(log) {
- var errors = [];
- this.message = function() { return errors.join("\n"); };
- return jasmine.showsBuildLog(this.actual, log, errors);
- },
-
- toShowActiveTab: function(tab) {
- var errors = [];
- this.message = function() { return errors.join("\n"); };
- return jasmine.showsActiveTab(this.actual, tab, errors);
- }
- });
-});
-
View
67 spec/javascripts/helpers/spec_helper.js
@@ -1,67 +0,0 @@
-// TODO somehow make this accessible through cli
-// Ember.LOG_BINDINGS = true;
-
-var Test = {
- html: '<div id="tab_recent"><div class="tab"></div></div>' +
- '<div id="main"></div>' +
- '<div id="workers"></div>' +
- '<div id="jobs"></div>'
-};
-
-beforeEach(function() {
- Travis.Query._cache = {};
- Travis.store = Ember.Store.create().from('Travis.DataSource');
-
- // $.ajax({ async: false, url: "/repositories/1.json", success: function(record) {
- // Travis.store.loadRecord(Travis.Repository, record, 1);
- // }});
-
- jasmine.Ajax.useMock();
-
- // We add these html elements in the specs so we can look at styled content
- // when run in the browser. For jasmine-headless-webkit we therefor need to
- // inject them to the dom.
-
- $('#jasmine_content').html(Test.html);
-
- $.each(['#tab_recent .tab', '#main', '#workers', '#jobs'], function(ix, selector) {
- $(selector).empty();
- });
-});
-
-var createView = function(selector, options) {
- var view = Ember.View.create(options);
- Ember.run(function() { view.appendTo(selector) });
- return view;
-};
-
-var withinRunLoop = function(block) {
- Ember.RunLoop.begin();
- var result = block();
- Ember.RunLoop.end();
- return result;
-};
-
-var whenReady = function(object, callback) {
- waitsFor(function() {
- return object.get('status') & Ember.Record.READY;
- });
- runs(function() {
- callback();
- });
-};
-
-var runsAfter = function(time, func) {
- waits(time);
- jasmine.getEnv().currentSpec.runs(func);
-};
-
-var runsWhen = function(condition, func) {
- waitsFor(condition);
- jasmine.getEnv().currentSpec.runs(func);
-};
-
-$('document').ready(function() {
- $('body').append($('<div id="jasmine_content"></div>'));
-});
-
View
122 spec/javascripts/lib/deansi_spec.js
@@ -1,122 +0,0 @@
-describe('Travis.Log.deansi', function() {
- function deansi(string) {
- return Travis.Log.deansi(string);
- }
-
- describe('colors', function() {
- var sets = [
- { ansi: "30", class: 'black' },
- { ansi: "31", class: 'red' },
- { ansi: "32", class: 'green' },
- { ansi: "33", class: 'yellow' },
- { ansi: "34", class: 'blue' },
- { ansi: "35", class: 'magenta' },
- { ansi: "36", class: 'cyan' },
- { ansi: "37", class: 'white' },
- { ansi: "90", class: 'grey' },
- { ansi: "30;1", class: 'black bold' },
- { ansi: "31;1", class: 'red bold' },
- { ansi: "32;1", class: 'green bold' },
- { ansi: "34;1", class: 'blue bold' },
- { ansi: "33;1", class: 'yellow bold' },
- { ansi: "35;1", class: 'magenta bold' },
- { ansi: "36;1", class: 'cyan bold' },
- { ansi: "37;1", class: 'white bold' },
- { ansi: "42;37;1", class: 'white bg-green bold' }
- ];
-
- sets = sets.map(function (set) {
- return { ansi: "\033[" + set.ansi + 'm', class: set.class };
- });
-
- it('removes all occurrences of \e(B', function() {
- str = String.fromCharCode(27) + '(Bfoo' + String.fromCharCode(27) + '(Bbar'
- expect(deansi(str)).toEqual('foobar');
- });
-
- it('removes all occurrences of \e', function() {
- expect(deansi(String.fromCharCode(27) + 'foo' + String.fromCharCode(27) + 'bar')).toEqual('foobar');
- });
-
- it('replaces ANSI escape sequences having no closing sequence with a span having the respective css classes', function() {
- $.each(sets, function(ix, set) {
- var source = (set.ansi + 'FOO').repeat(3);
- var expected = ('<span class="' + set.class +'">FOO</span>').repeat(3);
- expect(deansi(source)).toEqual(expected);
- });
- });
-
- it('replaces ANSI escape sequences having a closing sequence [m with a span having the respective css classes', function() {
- $.each(sets, function(ix, set) {
- var source = (set.ansi + 'FOO\033[m').repeat(3);
- var expected = ('<span class="' + set.class +'">FOO</span>').repeat(3);
- expect(deansi(source)).toEqual(expected);
- });
- });
-
- it('replaces ANSI escape sequences having a closing sequence [0m with a span having the respective css classes', function() {
- $.each(sets, function(ix, set) {
- var source = (set.ansi + 'FOO\033[0m').repeat(3);
- var expected = ('<span class="' + set.class +'">FOO</span>').repeat(3);
- expect(deansi(source)).toEqual(expected);
- });
- });
-
- it('replaces ANSI escape sequence (real examples)', function() {
- var examples = [
- { source: '\033[42;37;1mPassed\033[0m', result: '<span class="white bg-green bold">Passed</span>' },
- { source: '\033[0;33;40mFailure', result: '<span class="yellow bg-black">Failure</span>' },
- { source: '\033[0;37;40mSuccess', result: '<span class="white bg-black">Success</span>' },
- { source: '\033[32m.\033[0m\033[31mF\033[0m', result: '<span class="green">.</span><span class="red">F</span>' },
- { source: '\033[31m2 failed\033[0m, \033[33m2 undefined\033[0m, \033[32m35 passed\033[0m', result: '<span class="red">2 failed</span>, <span class="yellow">2 undefined</span>, <span class="green">35 passed</span>' },
- { source: '\033[31m2 failed\033[0m, \033[36m1 skipped\033[0m, \033[33m7 undefined\033[0m, \033[32m212 passed\033[0m', result: '<span class="red">2 failed</span>, <span class="cyan">1 skipped</span>, <span class="yellow">7 undefined</span>, <span class="green">212 passed</span>' },
- { source: '\033[32mUsing /home/vagrant/.rvm/gems/ruby-1.8.7-p334\033[m' + String.fromCharCode(27) + '(B\r\n', result: '<span class="green">Using /home/vagrant/.rvm/gems/ruby-1.8.7-p334</span>\r\n' },
- { source: '\033[32mYour bundle is complete! Use `bundle show [gemname]` to see ...\033[0m\r\n', result: '<span class="green">Your bundle is complete! Use `bundle show [gemname]` to see ...</span>\r\n' },
- { source: '\033[31mcucumber features/command_line.feature:176\033[0m\033[90m # Scenario: Recompiling a project\033[0m\r\n', result: '<span class="red">cucumber features/command_line.feature:176</span><span class="grey"> # Scenario: Recompiling a project</span>\r\n' },
- { source: '\033[30;42m\033[2KOK (22 tests, 31 assertions)\n\033[0m\nGenerating textual code coverage report, this may take a moment.', result: '<span class="black bg-green">OK (22 tests, 31 assertions)\n</span>\nGenerating textual code coverage report, this may take a moment.' }
- ];
- $.each(examples, function(ix, example) {
- expect(deansi(example.source)).toEqual(example.result);
- });
- });
- });
-
- describe('carriage returns', function() {
- it('replaces a line followed by a carriage return', function() {
- var source = 'remote: Compressing objects: 100% (21/21) \rremote: Compressing objects: 100% (21/21), done.';
- var expected = 'remote: Compressing objects: 100% (21/21), done.';
- expect(deansi(source)).toEqual(expected);
- });
-
- it('replaces a line followed by an ansii clear line escape sequence and a carriage return', function() {
- var source = 'remote: Compressing objects: 98% (20/21) \033[K\rremote: Compressing objects: 100% (21/21), done.';
- var expected = 'remote: Compressing objects: 100% (21/21), done.';
- expect(deansi(source)).toEqual(expected);
- });
-
- it('removes [K sequences preceeding a carriage return', function() {
- var source = 'remote: Compressing objects: 100% (21/21), done. \033[K\r';
- var expected = 'remote: Compressing objects: 100% (21/21), done. \r';
- expect(deansi(source)).toEqual(expected);
- });
-
- it('removes [2K sequences', function() {
- var source = '\033[2KOK (22 tests, 31 assertions)';
- var expected = 'OK (22 tests, 31 assertions)';
- expect(deansi(source)).toEqual(expected);
- });
-
- it('does not replaces a line followed by a carriage return when this is the last character in the string', function() {
- var source = 'remote: Compressing objects: 100% (21/21) \r';
- var expected = 'remote: Compressing objects: 100% (21/21) \r';
- expect(deansi(source)).toEqual(expected);
- });
-
- it('does not replace a line followed by a carriage return and a newline', function() {
- var source = 'remote: Counting objects: 31, done.\r\nremote: Compressing objects: 100% (21/21), done.';
- var expected = 'remote: Counting objects: 31, done.\r\nremote: Compressing objects: 100% (21/21), done.';
- expect(deansi(source)).toEqual(expected);
- });
- });
-});
-
View
41 spec/javascripts/lib/travis/datasource_spec.js
@@ -1,41 +0,0 @@
-describe("Travis.Datasource", function() {
- var store, source;
- var responses = {
- repositories: { status: 200, responseText: JSON.stringify([{ id: 1, slug: 'travis-ci/travis-ci' }]) }
- };
-
- beforeEach(function() {
- store = Travis.store = Ember.Store.create().from('Travis.DataSource');
- source = store._getDataSource();
- });
-
- describe('fetch', function() {
- it('fetches a collection and loads it to the store', function() {
- spyOn(store, 'loadRecords');
- var query = Travis.Query.cached(Travis.Repository);
- source.fetch(store, query);
- mostRecentAjaxRequest().response(responses.repositories);
- expect(store.loadRecords).toHaveBeenCalled();
- });
-
- it('notifies the store that it has fetched the query', function() {
- var query = Travis.Query.cached(Travis.Repository);
- spyOn(store, 'dataSourceDidFetchQuery');
- source.fetch(store, query);
- mostRecentAjaxRequest().response(responses.repositories);
- expect(store.dataSourceDidFetchQuery).toHaveBeenCalledWith(query);
- });
- });
-
- describe('retrieveRecord', function() {
- it('fetches a single record and loads it to the store', function() {
- });
- });
-
- it('finding a collection works', function() {
- var repositories = store.find(Travis.Repository);
- mostRecentAjaxRequest().response(responses.repositories);
- expect(repositories.get('length')).toEqual(1);
- });
-});
-
View
46 spec/javascripts/lib/travis/log/filter_spec.js
@@ -1,46 +0,0 @@
-describe("Travis.Log", function() {
- describe('stripPaths', function() {
- it('removes the path to the build directory in /tmp', function() {
- var source = 'foo\n/home/vagrant/builds/svenfuchs/rails/activesupport/lib/active_support/core_ext/hash/slice.rb:15';
- var result = 'foo\nactivesupport/lib/active_support/core_ext/hash/slice.rb:15';
- expect(Travis.Log.stripPaths(source)).toEqual(result);
- });
- });
-
- describe('escapeHtml', function() {
- it('escapes html tags', function() {
- var source = '<foo>bar</foo>';
- var result = '&lt;foo&gt;bar&lt;/foo&gt;';
- expect(Travis.Log.escapeHtml(source)).toEqual(result);
- });
- });
-
- describe('escapeRuby', function() {
- it('escapes ruby style object output', function() {
- var source = '#<Object:0x00000005fb3628>';
- var result = '#&lt;Object:0x00000005fb3628&gt;';
- expect(Travis.Log.escapeRuby(source)).toEqual(result);
- });
- });
-
- describe('numberLines', function() {
- it('wraps each line into a p tag including an anchor', function() {
- spyOn(Travis.Log, 'location').andReturn('#!travis-ci/travis-ci/L99');
-
- var source = Travis.Log.fold('foo\nbar\nbaz');
- var result =
- '<p><a href="#!travis-ci/travis-ci/L1" id="!travis-ci/travis-ci/L1" name="L1">1</a>foo</p>\n' +
- '<p><a href="#!travis-ci/travis-ci/L2" id="!travis-ci/travis-ci/L2" name="L2">2</a>bar</p>\n' +
- '<p><a href="#!travis-ci/travis-ci/L3" id="!travis-ci/travis-ci/L3" name="L3">3</a>baz</p>';
-
- expect(Travis.Log.numberLines(source)).toEqual(result);
- });
- });
-
- describe('foldLog', function() {
- it('wraps the matched section into a div', function() {
- var source = Travis.Log.numberLines('$ foo\n$ bundle install\nUsing a\nUsing b\nYour bundle is complete! Use `bundle show [gemname]`.');
- expect(Travis.Log.fold(source)).toMatch(/<div class="fold bundle">/);
- });
- });
-});
View
122 spec/javascripts/lib/travis/log/fold_pattern_spec.js
@@ -1,122 +0,0 @@
-describe("Travis.Log", function() {
- describe('the fold pattern', function() {
- describe('for bundle install', function() {
- it('matches with single line breaks', function() {
- var log = '$ bundle install\n' +
- 'Fetching source index for http://rubygems.org/\n' +
- 'Using rake (0.9.2)\n' +
- 'Installing rcov (0.9.9) with native extensions WARNING: rcov-0.9.9 has an invalid nil value for @cert_chain\n\n' +
- 'Using diaspora-client (0.1.0) from git://github.com/diaspora/diaspora-client.git (at master)\n' +
- 'foo\nbar';
-
- expect(Travis.Log.numberLines(log)).toMatch(Travis.Log.FOLDS['bundle']);
- });
-
- it('matches with multiple line breaks', function() {
- var log = '$ bundle install\n' +
- 'Fetching source index for http://rubygems.org/\n\n' +
- 'Using rake (0.9.2)\n\n' +
- 'Installing rcov (0.9.9) with native extensions WARNING: rcov-0.9.9 has an invalid nil value for @cert_chain\n\n' +
- 'Using diaspora-client (0.1.0) from git://github.com/diaspora/diaspora-client.git (at master)\n\n';
-
- expect(Travis.Log.numberLines(log)).toMatch(Travis.Log.FOLDS['bundle']);
- });
- });
-
- describe('for rake db:migrate', function() {
- it('matches with bundle exec prepended', function() {
- var log = '$ bundle exec rake db:create db:migrate test\n' +
- '== CreateSettings: migrating =================================================\n' +
- '-- create_table(:settings)\n' +
- ' -> 0.0016s\n' +
- '== CreateSettings: migrated (0.0017s) ========================================\n';
-
- expect(Travis.Log.numberLines(log)).toMatch(Travis.Log.FOLDS['migrate']);
- });
-
- it('matches with single line breaks', function() {
- var log = '$ rake db:create db:migrate test\n' +
- '== CreateSections: migrating =================================================\n' +
- '-- create_table(:sections)\n' +
- ' -> 0.0010s\n' +
- '-- add_index(:sections, :main_section_id)\n' +
- ' -> 0.0004s\n' +
- '== CreateSections: migrated (0.0016s) ========================================\n\n' +
- '== CreateSettings: migrating =================================================\n' +
- '-- create_table(:settings)\n' +
- ' -> 0.0016s\n' +
- '== CreateSettings: migrated (0.0017s) ========================================\n';
-
- expect(Travis.Log.numberLines(log)).toMatch(Travis.Log.FOLDS['migrate']);
- });
-
- it('matches with multiple line breaks', function() {
- var log = '$ rake db:create db:migrate test\n\n' +
- '== CreateSections: migrating =================================================\n\n' +
- '-- create_table(:sections)\n\n' +
- ' -> 0.0010s\n\n' +
- '-- add_index(:sections, :main_section_id)\n\n' +
- ' -> 0.0004s\n\n' +
- '== CreateSections: migrated (0.0016s) ========================================\n\n\n\n' +
- '== CreateSettings: migrating =================================================\n\n' +
- '-- create_table(:settings)\n\n' +
- ' -> 0.0016s\n\n' +
- '== CreateSettings: migrated (0.0017s) ========================================\n\n';
-
- expect(Travis.Log.numberLines(log)).toMatch(Travis.Log.FOLDS['migrate']);
- });
- });
-
- describe('for rake schema:load', function() {
- it('matches with bundle exec prepended', function() {
- var log = '$ bundle exec rake db:schema:load\n' +
- '-- create_table("aspect_memberships", {:force=>true})\n' +
- ' -> 0.2026s\n' +
- '-- add_index("aspect_memberships", ["aspect_id"], {:name=>"index_aspect_memberships_on_aspect_id"})\n' +
- ' -> 0.0444s\n' +
- '-- assume_migrated_upto_version(20110830170929, "db/migrate")\n' +
- ' -> 0.0444s\n';
-
- expect(Travis.Log.numberLines(log)).toMatch(Travis.Log.FOLDS['schema']);
- });
-
- it('matches with single line breaks', function() {
- var log = '$ rake db:schema:load\n' +
- '-- create_table("aspect_memberships", {:force=>true})\n' +
- ' -> 0.2026s\n' +
- '-- add_index("aspect_memberships", ["aspect_id"], {:name=>"index_aspect_memberships_on_aspect_id"})\n' +
- ' -> 0.0444s\n' +
- '-- assume_migrated_upto_version(20110830170929, "db/migrate")\n' +
- ' -> 0.0444s\n';
-
- expect(Travis.Log.numberLines(log)).toMatch(Travis.Log.FOLDS['schema']);
- });
-
- it('matches with multiple line breaks', function() {
- var log = '$ rake db:schema:load\n\n' +
- '-- create_table("aspect_memberships", {:force=>true})\n\n' +
- ' -> 0.2026s\n\n' +
- '-- add_index("aspect_memberships", ["aspect_id"], {:name=>"index_aspect_memberships_on_aspect_id"})\n\n' +
- ' -> 0.0444s\n' +
- '-- assume_migrated_upto_version(20110830170929, "db/migrate")\n' +
- ' -> 0.0444s\n';
-
- expect(Travis.Log.numberLines(log)).toMatch(Travis.Log.FOLDS['schema']);
- });
- });
-
- describe('for executing ruby lines', function() {
- it('matches lines like output by rake', function() {
- var log = '/home/vagrant/.rvm/rubies/ree-1.8.7-2011.03/bin/ruby -S bundle exec rspec ./spec/controllers/aspect_memberships_controller_spec.rb ./spec/controllers/activity_streams/photos_controller_spec.rb';
-
- expect(Travis.Log.numberLines(log)).toMatch(Travis.Log.FOLDS['exec']);
- });
-
- it('does not match other lines starting with a path to the rvm ruby dir', function() {
- var log = "/home/vagrant/.rvm/rubies/ruby-1.8.7-p334/lib/ruby/site_ruby/1.8/rubygems/spec_fetcher.rb:133:in `load': marshal data too short (ArgumentError)\r\n";
-
- expect(Travis.Log.numberLines(log)).not.toMatch(Travis.Log.FOLDS['exec']);
- });
- });
- });
-});
View
230 spec/javascripts/lib/travis/log/incremental_spec.js
@@ -1,230 +0,0 @@
-// Log = function(url, patterns) {
-// this.lines = [];
-// this.url = url;
-// this.patterns = patterns;
-// };
-//
-// Log.prototype = {
-// append: function(string) {
-// string = this.prependBuffer(string);
-// string = this.chopBuffer(string);
-//
-// if(string.length > 0) {
-// $.each(string.split('\\n'), function(ix, line) {
-// this.lines.push(new Log.Line(this, line));
-// }.bind(this));
-// }
-// },
-//
-// prependBuffer: function(string) {
-// if(this.buffer) {
-// string = this.buffer + string;
-// delete this.buffer;
-// }
-// return string;
-// },
-//
-// chopBuffer: function(string) {
-// if(string == '\\n') {
-// } else if(string.slice(-1) == '\\n') {
-// string = string.slice(0, -1);
-// } else {
-// var ix = string.lastIndexOf('\\n');
-// if(ix == -1) {
-// this.buffer = string;
-// string = '';
-// } else {
-// this.buffer = string.slice(ix, string.length);
-// string = string.slice(ix);
-// }
-// }
-// return string;
-// },
-//
-// toString: function() {
-// return this.lines.join('');
-// }
-// };
-//
-// Log.Line = function(log, line) {
-// this.log = log;
-// this.patterns = log.patterns;
-// this.line = line;
-// this.previous = log.lines[log.lines.length - 1];
-// this.number = log.lines.length + 1;
-//
-// this.match();
-// }
-//
-// Log.Line.prototype = {
-// match: function(current) {
-// if(this.log.state == undefined || this.log.state == 'finish') {
-// this.start();
-// return;
-// }
-//
-// if(this.log.state == 'start' || this.log.state == 'include') {
-// if(this.include()) {
-// return;
-// }
-// }
-//
-// this.finish();
-// },
-//
-// start: function() {
-// // console.log('start: ' + this.line)
-// for(fold in this.patterns) {
-// var pattern = this.patterns[fold].start;
-// if(this.line.match(pattern)) {
-// this.log.state = 'start'
-// this.log.fold = fold;
-// this.prefix = '<div class"fold ' + fold + '">';
-// }
-// }
-// },
-//
-// include: function() {
-// // console.log('include: [' + this.log.fold + ']: ' + this.line)
-// var pattern = this.patterns[this.log.fold].include;
-// if(pattern) {
-// if(this.line.match(pattern)) {
-// this.log.state = 'include';
-// } else {
-// this.log.state = 'finish';
-// this.previous.suffix += '</div>';
-// }
-// return true;
-// }
-// },
-//
-// finish: function() {
-// // console.log('finish: [' + this.log.fold + ']: ' + this.line)
-// var pattern = this.patterns[this.log.fold].finish;
-// if(pattern) {
-// if(this.line.match(pattern)) {
-// this.log.state = 'finish';
-// this.suffix = '</div>';
-// return true;
-// }
-// }
-// },
-//
-// toString: function() {
-// if(!('string' in this)) {
-// this.string = this.finalize();
-// }
-// return this.string;
-// },
-//
-// finalize: function() {
-// return [this.prefix, this.link(), this.line, this.suffix].join('');
-// },
-//
-// link: function() {
-// return '<p><a href="' + this.log.url + '">' + this.number + '</a></p>';
-// }
-// }
-//
-// describe('Log:', function() {
-// describe('incremental parsing', function() {
-// it('using an include pattern', function() {
-// var log = new Log('#', { bundle: { start: /^\\$ bundle install/, include: /^(Fetching|Using) / } });
-//
-// var lines = [
-// 'Using worker: ruby2.worker.travis-ci.org:worker-3\\n',
-// '$ bundle install\\n',
-// 'Fetching source index for http://rubygems.org/\\n',
-// 'Your bundle is complete! Use `bundle show [gemname]` to see where a bundled gem is installed.\\n'
-// ];
-// $.each(lines, function(ix, line) { log.append(line) });
-//
-// var expected = 'Using worker: ruby2.worker.travis-ci.org:worker-3\\n' +
-// '<fold class"bundle">$ bundle install\\n' +
-// 'Fetching source index for http://rubygems.org/</fold>\\n' +
-// 'Your bundle is complete! Use `bundle show [gemname]` to see where a bundled gem is installed.'
-// expect(log.toString()).toEqual(expected);
-// });
-//
-// it('using a finish pattern', function() {
-// var log = new Log('#', { bundle: { start: /^\\$ bundle install/, finish: /^Your bundle/ } });
-//
-// var lines = [
-// 'Using worker: ruby2.worker.travis-ci.org:worker-3\\n',
-// '$ bundle install\\n',
-// 'Fetching source index for http://rubygems.org/\\n',
-// 'Your bundle is complete! Use `bundle show [gemname]` to see where a bundled gem is installed.\\n'
-// ];
-// $.each(lines, function(ix, line) { log.append(line) });
-//
-// var expected = 'Using worker: ruby2.worker.travis-ci.org:worker-3\\n' +
-// '<fold class"bundle">$ bundle install\\n' +
-// 'Fetching source index for http://rubygems.org/\\n' +
-// 'Your bundle is complete! Use `bundle show [gemname]` to see where a bundled gem is installed.</fold>'
-// expect(log.toString()).toEqual(expected);
-// });
-//
-// describe('chunks', function() {
-// it('with a single chunked line', function() {
-// var log = new Log('#', { bundle: { start: /^\\$ bundle install/ } });
-//
-// var lines = [ '$ bundle', ' install\\n', ];
-// $.each(lines, function(ix, line) { log.append(line) });
-//
-// var expected = '<fold class"bundle">$ bundle install';
-// expect(log.toString()).toEqual(expected);
-// });
-//
-// it('with multiple chunked lines', function() {
-// var log = new Log('#', { bundle: { start: /^\\$ bundle install/ } });
-//
-// var lines = [ '$ bu', 'ndle', ' inst', 'all\\n', ];
-// $.each(lines, function(ix, line) { log.append(line) });
-//
-// var expected = '<fold class"bundle">$ bundle install';
-// expect(log.toString()).toEqual(expected);
-// });
-// });
-//
-// describe('more real world', function() {
-// it('parses a bundle install section', function() {
-// var log = new Log('#', { bundle: { start: /^\\$ bundle install/, include: /^(Updating|Using|Installing|Fetching|remote:|Receiving|Resolving) / } });
-//
-// var lines = [
-// 'Using worker: ruby2.worker.travis-ci.org:worker-3\\n',
-// '$ bundle install\\n',
-// 'Fetching git://github.com/nabeta/isbn-tools.git\\n',
-// 'remote: Counting objects: 49, done.\\n',
-// 'remote: Compressing objects: 100% (25/25), done.[K\\n',
-// 'Receiving objects: 100% (49/49), 9.69 KiB, done.\\n',
-// 'Resolving deltas: 100% (15/15), done.\\n',
-// 'Fetching git://github.com/swanandp/acts_as_list.git\\n',
-// 'remote: Counting objects: 199, done.[K\\n',
-// 'remote: Compressing objects: 100% (122/122), done.[K\\n',
-// 'remote: Total 199 (delta 64), reused 167 (delta 34)[K\\n',
-// 'Receiving objects: 100% (199/199), 28.76 KiB, done.\\n',
-// 'Resolving deltas: 100% (64/64), done.\\n',
-// 'Fetching source index for http://rubygems.org/\\n',
-// 'Using rake (0.9.2)\\n',
-// 'Installing RedCloth (4.2.8) with native extensions\\n',
-// 'Installing Saikuro (1.1.0) WARNING: Saikuro-1.1.0 has an invalid nil value for @cert_chain\\n',
-// '\\n',
-// 'Installing aaronh-chronic (0.3.9)\\n',
-// 'Installing abstract (1.0.0) WARNING: abstract-1.0.0 has an invalid nil value for @cert_chain\\n',
-// '\\n',
-// 'Your bundle is complete! Use `bundle show [gemname]` to see where a bundled gem is installed.\\n',
-// '$ bundle exec rake\\n'
-// ];
-// $.each(lines, function(ix, line) { log.append(line) });
-//
-// var expected = 'Using worker: ruby2.worker.travis-ci.org:worker-3\\n' +
-// '<fold class"bundle">$ bundle install\\n' +
-// 'Fetching source index for http://rubygems.org/</fold>\\n' +
-// 'Your bundle is complete! Use `bundle show [gemname]` to see where a bundled gem is installed.'
-//
-// console.log(log.toString());
-// // expect(log.toString()).toEqual(expected);
-// });
-// });
-// });
-// });
View
82 spec/javascripts/lib/travis/query_spec.js
@@ -1,82 +0,0 @@
-describe('Travis.Query', function() {
- var query = function(options) {
- return Travis.Query.create({ recordType: Travis.Repository, options: options });
- };
-
- describe('class methods', function() {
- describe('cached', function() {
- it('generates a new query unless cached', function() {
- var query = Travis.Query.cached(Travis.Repository);
- expect(Ember.typeOf(query)).toEqual('instance');
- });
-
- it('returns a cached query', function() {
- var cached = function() { return Travis.Query.cached(Travis.Repository) };
- expect(cached()).toEqual(cached());
- });
- });
-
- describe('key', function() {
- it('returns a serialized version of the arguments', function() {
- expect(Travis.Query.key('local', { recordType: Travis.Repository, options: { id: 1 } })).toEqual('local:/repositories/1.json');
- });
- });
- });
-
- describe('instance methods', function() {
- describe('path', function() {
- it('returns /repositories.json for a query that looks up a collection', function() {
- expect(query({}).path()).toEqual('/repositories.json');
- });
-
- it('returns /repositories/1.json for a query that looks up a single record', function() {
- expect(query({ id: 1 }).path()).toEqual('/repositories/1.json');
- });
- });
-
- describe('params', function() {
- it('returns page=1', function() {
- expect(query({ page: 1 }).params()).toEqual('page=1');
- });
-
- it('does not include a given id value', function() {
- expect(query({ page: 1, id: 1 }).params()).toEqual('page=1');
- });
-
- it('does not include a given orderBy value', function() {
- expect(query({ page: 1, orderBy: 'orderBy' }).params()).toEqual('page=1');
- });
-
- it('returns undefined if no valid params were given', function() {
- expect(query({}).params()).toEqual(undefined);
- });
- });
-
- describe('url', function() {
- it('returns /repositories.json for a query that does not have any parameters', function() {
- expect(query({}).url()).toEqual('/repositories.json');
- });
-
- it('returns /repositories.json?page=1 for a query that has extra parameters', function() {
- expect(query({ page: 1 }).url()).toEqual('/repositories.json?page=1');
- });
- });
-
- describe('conditions', function() {
- it('returns conditions suitable for being used in an Ember.Query', function() {
- expect(query({ slug: 'travis-ci/travis-ci' }).conditions()).toEqual('slug = "travis-ci/travis-ci"');
- });
- });
-
- describe('quote', function() {
- it('quotes stings', function() {
- expect(query().quote('name', 'string')).toEqual('"string"');
- });
-
- it('does not quote non-strings', function() {
- expect(query().quote('id', 1)).toEqual(1);
- });
- });
- });
-});
-
View
51 spec/javascripts/lib/travis/record_spec.js
@@ -1,51 +0,0 @@
-describe('Travis.Record', function() {
- describe('class methods', function() {
- describe('all', function() {
- var data_source;
-
- beforeEach(function() {
- data_source = Travis.store._getDataSource();
- });
-
- it('calls fetch on the datasource passing a local query', function() {
- var query;
- spyOn(data_source, 'fetch').andCallFake(function() { query = arguments[1]; });
- Travis.Repository.all();
- expect(query.get('isLocal')).toBeTruthy();
- });
-
- it('returns a RecordArray with the records loaded', function() {
- var repositories = Travis.Repository.all();
- var response = { status: 200, responseText: JSON.stringify([{ id: 1, slug: 'travis-ci/travis-ci' }])};
- mostRecentAjaxRequest().response(response);
-
- whenReady(repositories, function() {
- expect(repositories.get('length')).toEqual(1);
- expect(repositories.objectAt(0).get('slug')).toEqual('travis-ci/travis-ci');
- });
- });
-
- it('requests GET /repositories.json when given no further parameters', function() {
- Travis.Repository.all();
- expect(mostRecentAjaxRequest().url).toEqual('/repositories.json');
- });
-
- it('requests GET /repositories.json?page=1 when given parameters', function() {
- Travis.Repository.all({ page: 1 });
- expect(mostRecentAjaxRequest().url).toEqual('/repositories.json?page=1');
- });
- });
- });
-
- describe('instance methods', function() {
- describe('update', function() {
- it('sets the given attributes', function() {
- var repository = Test.Factory.Repository.travis();
- repository.update({ name: 'bob-the-builder' });
-
- repository = Travis.Repository.find(repository.get('id'));
- expect(repository.get('name')).toEqual('bob-the-builder');
- });
- });
- });
-});
View
124 spec/javascripts/models/build_spec.js
@@ -1,124 +0,0 @@
-describe('Build', function() {
- describe('class methods', function() {
- describe('pushesByRepositoryId', function() {
- it('requests GET /repositories.json', function() {
- Travis.Build.pushesByRepositoryId(1);
- expect(mostRecentAjaxRequest().url).toEqual('/repositories/1/builds.json?bare=true');
- });
- });
-
- describe('pullRequestsByRepositoryId', function() {
- it('requests GET /repositories.json', function() {
- Travis.Build.pullRequestsByRepositoryId(1);
- expect(mostRecentAjaxRequest().url).toEqual('/repositories/1/builds.json?bare=true&event_type=pull_requests');
- });
- });
-
- describe('createOrUpdate', function() {
- it('calls createOrUpdate for each of the matrix builds, too', function() {
- var build = Travis.Build.createOrUpdate({ id: 99, number: '1', matrix: [{ id: 2, number: '1.1' }]});
- build = Travis.Build.find(build.get('id'));
-
- expect(build.get('number')).toEqual(1);
- expect(build.getPath('matrix.firstObject.number')).toEqual('1.1');
- });
- });
- });
-
- describe('instance', function() {
- var repository, build;
-
- beforeEach(function() {
- repository = Test.Factory.Repository.travis();
- build = Test.Factory.Build.passing();
- });
-
- describe('associations', function() {
- it('has many tests as a matrix', function() {
- expect(build.get('matrix').objectAt(0).get('number')).toEqual('1.1'); // what's a better way to test this? is there something like className in sc 2?
- });
-
- it('belongs to a repository', function() {
- var _repository = build.get('repository');
- whenReady(_repository, function() {
- expect(_repository.get('slug')).toEqual(repository.get('slug'));
- })
- });
- });
-
- // update
- // it updates with the given attributes
- // it does partial updates on matrix job attributes
-
- // updateTimes
- // it updates properties based on duration
- // it updates properties based on finished_at
-
- // isMatrix
- // returns true if the matrix has more than one build
- // returns false if the matrix has only one build
- // updates bindings when the matrix length changes
-
- describe('properties', function() {
- describe('color', function() {
- it('returns "green" if the build has passed', function() {
- build.set('result', 0);
- expect(build.get('color')).toEqual('green');
- });
-
- it('returns "red" if the build has failed', function() {
- build.set('result', 1);
- expect(build.get('color')).toEqual('red');
- });
-
- it('returns undefined if the build result is unknown', function() {
- build.set('result', null);
- expect(build.get('color')).toEqual(undefined);
- });
-
- it('updates when the build result changes')
- });
-
- });
-
- describe('message', function() {
- it ('changes emoji to image tags', function() {
- build.set('message', 'The :cake: is a lie');
- expect(build.get('formattedMessage')).toEqual('The <img class="emoji" title=":cake:" alt=":cake:" src="/assets/emoji/cake.png"/> is a lie');
- });
-
- it ('changes multiple emoji to image tags', function() {
- build.set('message', 'I :heart: :cake:');
- expect(build.get('formattedMessage')).toEqual('I <img class="emoji" title=":heart:" alt=":heart:" src="/assets/emoji/heart.png"/> <img class="emoji" title=":cake:" alt=":cake:" src="/assets/emoji/cake.png"/>');
- });
-
- it ('changes emoji not separated by spaces to image tags', function() {
- build.set('message', 'I :heart::cake:');
- expect(build.get('formattedMessage')).toEqual('I <img class="emoji" title=":heart:" alt=":heart:" src="/assets/emoji/heart.png"/><img class="emoji" title=":cake:" alt=":cake:" src="/assets/emoji/cake.png"/>');
- });
-
- it ('changes multiple identical emoji to image tags', function() {
- build.set('message', 'I :heart: :heart:');
- expect(build.get('formattedMessage')).toEqual('I <img class="emoji" title=":heart:" alt=":heart:" src="/assets/emoji/heart.png"/> <img class="emoji" title=":heart:" alt=":heart:" src="/assets/emoji/heart.png"/>');
- });
-
- it ('does not change message without emoji', function() {
- build.set('message', 'Issue: This is normal commit :: Something with ActiveSupport::Callbacks: remove __define_runner');
- expect(build.get('formattedMessage')).toEqual('Issue: This is normal commit :: Something with ActiveSupport::Callbacks: remove __define_runner');
- });
-
- it ('trims message to first line in build list for shortMessage', function() {
- build.set('message', 'First line of commit.\n\nSecond line of commit');
- expect(build.get('shortMessage')).toEqual('First line of commit.');
-
- build.set('message', 'First line of commit.\nSecond line of commit');
- expect(build.get('shortMessage')).toEqual('First line of commit.');
- });
-
- it ('shows mulitple lines commits in multiple html lines', function() {
- build.set('message', 'First line of commit.\n\nSecond line of commit\nThird line.');
- expect(build.get('formattedMessage')).toEqual('First line of commit.<br/><br/>Second line of commit<br/>Third line.');
- });
- });
- });
-});
View
165 spec/javascripts/models/job_spec.js
@@ -1,165 +0,0 @@
-describe('Job', function() {
- var job, build;
- describe('instance', function() {
- beforeEach(function() {
- //this will create the travis repostiory and a passing build.
- job = Test.Factory.Job.single()
- build = Test.Factory.Build.passing()
- });
-
- describe('associations', function() {
- it('has a build', function() {
- expect(job.get('build').get('number')).toEqual(1);
- });
-
- it('belongs to a repository', function() {
- expect(job.get('repository').get('slug')).toEqual(build.get('repository').get('slug'));
- });
- });
-
- describe('properties', function() {
- describe('color', function() {
- it('returns "green" if the last build has passed', function() {
- job.set('result', 0);
- expect(job.get('color')).toEqual('green');
- });
-
- it('returns "red" if the last build has failed', function() {
- job.set('result', 1);
- expect(job.get('color')).toEqual('red');
- });
-
- it('returns undefined if the last build result is unknown', function() {
- job.set('result', null);
- expect(job.get('color')).toEqual(undefined);
- });
- });
-
- describe('duration', function() {
- it('returns a string for duration of the job', function() {
- expect(job.get('duration')).toEqual(10)
- });
-
- it('returns a duration of 0 if the job has not started or ended', function() {
- job.set('started_at', null)
- expect(job.get('duration')).toEqual(0)
- });
- });
-
- describe('formattedDuration', function() {
- it('returns the properly formatted string when the job is finished', function() {
- expect(job.get('formattedDuration')).toEqual('10 sec')
- });
-
- it('returns - when he job has not started yet', function() {
- job.set('started_at', null)
- expect(job.get('formattedDuration')).toEqual('-')
- });
- });
-
- describe('formattedFinishedAt', function() {
- it('returns a string for duration of the job', function() {
- expect(job.get('formattedFinishedAt').indexOf('ago')).toBeGreaterThan(0);
- });
-
- it('returns a duration of 0 if the job has not started or ended', function() {
- job.set('finished_at', null)
- expect(job.get('formattedFinishedAt')).toEqual('-')
- });
- });
-
-
- describe('formattedCommit', function() {
- it('returns a commit message formatted with the branch name', function() {
- expect(job.get('formattedCommit')).toEqual('4d7621e (master)')
- });
-
- it('returns an empty string when there is no commit meesage', function() {
- job.set('commit', null)
- job.set('branch', null)
- expect(job.get('formattedCommit')).toEqual('')
- });
- });
-
- describe('formattedCompareUrl', function() {
- it('returns an empty string when there is no compare_url', function() {
- expect(job.get('formattedCompareUrl')).toEqual('')
- });
-
- it('returns the last part in the url when there is a compare url', function() {
- job.set('compare_url', 'https://github.com/travis-ci/travis-ci/compare/9bc2212...9d1e44a')
- expect(job.get('formattedCompareUrl')).toEqual('9bc2212...9d1e44a')
- });
- });
-
- describe('formattedConfig', function() {
- it('returns the configuration formatted', function() {
- expect(job.get('formattedCompareUrl')).toEqual('')
- });
-
- it('returns the last part in the url when there is a compare url', function() {
- job.set('compare_url', 'https://github.com/travis-ci/travis-ci/compare/9bc2212...9d1e44a')
- expect(job.get('formattedCompareUrl')).toEqual('9bc2212...9d1e44a')
- });
- });
-
- describe('formattedConfigValues', function() {
-
- it('returns an empty array when there is nothing to format', function() {
- expect(job.get('formattedConfigValues')).toEqual([]);
- });
-
- it('returns the config items as an array of Ember Objects', function() {
- job.set('config', { rvm: ['1.9.2', 'rbx'], gemfile: ['Gemfile.rails-2.3.x', 'Gemfile.rails-3.x'] });
- config_values = $.map(job.get('formattedConfigValues'), function(item) {
- return item.get('value');
- })
- expect(config_values).toEqual(['1.9.2', 'rbx', 'Gemfile.rails-2.3.x', 'Gemfile.rails-3.x']);
- });
- });
-
- describe('formattedLog', function() {
- it('returns the log formatted', function() {
- expect(job.get('formattedLog')).toEqual('<p><a href="#/L1" id="/L1" name="L1">1</a>Done. Build script exited with: 0</p>')
- });
- });
-
- describe('formattedMessage', function() {
- it('returns the message formatted', function() {
- job.set('message','travis-ci is \n AWESOME :/')
- expect(job.get('formattedMessage')).toEqual('travis-ci is <br/> AWESOME :/')
- });
- });
-
- describe('url', function() {
- it('returns the url for this job', function() {
- expect(job.get('url')).toEqual('#!/travis-ci/travis-ci/jobs/9')
- });
- });
-
- });
-
- describe('methods', function() {
- it('update', function() {
- expect(job.get('result')).toBeNull();
- job.update({ result: 1 })
- expect(job.get('result')).toEqual(1);
- });
-
- it('appendLog', function() {
- job.set('log', 'test-1');
- job.appendLog('test-2');
- expect(job.get('log')).toEqual('test-1test-2');
- });
-
- it('subscribe', function() {
- expect(Travis.active_channels.indexOf('job-9')).toEqual(-1);
- job.subscribe()
- expect(Travis.active_channels.indexOf('job-9')).toEqual(0);
- });
-
- });
-
- });
-});
-
View
164 spec/javascripts/models/repository_spec.js
@@ -1,164 +0,0 @@
-describe('Travis.Repository', function() {
- describe('class methods', function() {
- describe('recent', function() {
- it('requests GET /repositories.json', function() {
- Travis.Repository.recent();
- expect(mostRecentAjaxRequest().url).toEqual('/repositories.json');
- });
- });
- });
-
- describe('instance', function() {
- var repository;
-
- beforeEach(function() {
- repository = Test.Factory.Repository.travis();
- });
-
- describe('attributes', function() {
- it('slug', function() {
- expect(repository.get('slug')).toEqual('travis-ci/travis-ci');
- });
-
- it('last_build_id', function() {
- expect(repository.get('last_build_id')).toEqual(1);
- });
-
- it('last_build_number', function() {
- expect(repository.get('last_build_number')).toEqual('1');
- });
-
- it('last_build_result', function() {
- expect(repository.get('last_build_result')).toEqual(0);
- });
-
- it('last_build_started_at', function() {
- expect(repository.get('last_build_started_at')).toEqual('2011-01-01T01:00:10Z');
- });
-
- it('last_build_finished_at', function() {
- expect(repository.get('last_build_finished_at')).toEqual('2011-01-01T01:00:20Z');
- });
- });
-
- describe('associations', function() {
- it('requests GET /repositories/1/builds.json?bare=true', function() {
- repository.get('builds');
- expect(mostRecentAjaxRequest().url).toEqual('/repositories/1/builds.json?bare=true');
- });
-
- // TODO no idea why this suddenly errors
- xit('has many builds', function() {
- var builds = repository.get('builds');
- mostRecentAjaxRequest().response({ result: 200, responseText: JSON.stringify([{ id: 1, number: '1', repository_id: 1 }]) });
- expect(builds.objectAt(0).get('number')).toEqual(1);
- });
- });
-
- describe('properties', function() {
- describe('color', function() {
- it('returns "green" if the last build has passed', function() {
- repository.set('last_build_result', 0);
- expect(repository.get('color')).toEqual('green');
- });
-
- it('returns "red" if the last build has failed', function() {
- repository.set('last_build_result', 1);
- expect(repository.get('color')).toEqual('red');
- });
-
- it('returns undefined if the last build result is unknown', function() {
- repository.set('last_build_result', null);
- expect(repository.get('color')).toEqual(undefined);
- });
- });
-
- describe('formattedLastBuildDuration', function() {
- it("returns a '-' if the last build's start time is not known", function() {
- repository.set('last_build_started_at', null);
- expect(repository.get('formattedLastBuildDuration')).toEqual('-');
- });
-
- it("returns a human readable duration using the current time if the last build's finished time is not known", function() {
- repository.set('last_build_finished_at', null);
- expect(repository.get('formattedLastBuildDuration')).toEqual('more than 24 hrs');
- });
-
- it("returns a human readable duration if the last build's start and finished times are both known", function() {
- expect(repository.get('formattedLastBuildDuration')).toEqual('10 sec');
- });
- });
-
- describe('formattedLastBuildFinishedAt', function() {
- it("returns a '-' if the last build's finished time is not known", function() {
- repository.set('last_build_finished_at', null);
- expect(repository.get('formattedLastBuildFinishedAt')).toEqual('-');
- });
-
- it("returns a human readable time ago string if the last build's finished time is known", function() {
- spyOn($.timeago, 'now').andReturn(new Date(Date.UTC(2011, 0, 1, 4, 0, 0)).getTime());
- expect(repository.get('formattedLastBuildFinishedAt')).toEqual('about 3 hours ago'); // TODO hmmm, some timezone difference here. is that a problem?
- });
- });
-
- describe('cssClasses', function() {
- it("returns css classes including 'repository'", function() {
- expect(repository.get('cssClasses').split(' ')).toContain('repository');
- });
-
- it("returns css classes not including 'green' if the last build result is not known", function() {
- repository.set('last_build_result', null);
- expect(repository.get('cssClasses').split(' ')).not.toContain('green');
- });
-
- it("returns css classes including 'green' if the last build has passed", function() {
- repository.set('last_build_result', 0);
- expect(repository.get('cssClasses').split(' ')).toContain('green');
- });
-
- it("returns css classes including 'red' if the last build has failed", function() {
- repository.set('last_build_result', 1);
- expect(repository.get('cssClasses').split(' ')).toContain('red');
- });
-
- it("returns css classes not including 'selected' if the repository is not currently selected", function() {
- repository.set('selected', false);
- expect(repository.get('cssClasses').split(' ')).not.toContain('selected');
- });
-
- it("returns css classes including 'selected' if the repository is currently selected", function() {
- repository.select();
- expect(repository.get('cssClasses').split(' ')).toContain('selected');
- });
- });
- });
-
- describe('methods', function() {
- describe('select', function() {
- var repositories;
-
- beforeEach(function() {
- repositories = Test.Factory.Repository.recent();
- });
-
- it('selects the given repository', function() {
- var repository = repositories.objectAt(0);
- repository.select();
- expect(repository.get('selected')).toBeTruthy();
- });
-
- it('deselects any other repositories in the timeline', function() {
- var travis = repositories.objectAt(0);
- var worker = repositories.objectAt(1);
-
- travis.select();
- worker.select();
-
- expect(travis.get('selected')).not.toBeTruthy();
- expect(worker.get('selected')).toBeTruthy();
- });
- });
- });
- });
-});
-
View
36 spec/javascripts/support/jasmine.yml
@@ -1,36 +0,0 @@
-assets:
- - application.js
-
-src_dir:
- - public/assets
-
-# src_files
-#
-src_files:
- - application.js
-
-# stylesheets
-#
-stylesheets:
- - stylesheets/**/*.css
-
-# spec_files
-#
-spec_files:
- - '**/*[sS]pec.js'
-
-# helpers
-#
-helpers:
- - helpers/spec_helper.js
- - helpers/factories.js
- - helpers/matchers.js
- - helpers/matchers_travis.js
- - vendor/jasmine_ajax.js
- - vendor/jasmine-jquery-1.3.1.js
- - vendor/jasmine-html-1.1.0.js
- # - vendor/jasmine-1.1.0.js
-
-# spec_dir
-#
-spec_dir: spec/javascripts
View
50 spec/javascripts/support/jasmine_config.rb
@@ -1,50 +0,0 @@
-$: << 'lib'
-
-require 'rubygems'
-require 'yaml'
-require 'webmock'
-
-config = YAML.load_file('spec/javascripts/support/jasmine.yml')
-
-WebMock.disable!
-require 'selenium/webdriver'
-# Patching for a bug in selenium webdriver that uses respond_to?
-module Selenium
- module WebDriver
- if MultiJson.singleton_methods.include?('load')
- # @api private
- def self.json_load(obj)
- MultiJson.load(obj)
- end
- else
- # @api private
- def self.json_load(obj)
- MultiJson.decode(obj)
- end
- end
- end
-
- module Jasmine
-
- class Config
- # Add your overrides or custom config code here
- end
-
- end
-end
-
-
-# Note - this is necessary for rspec2, which has removed the backtrace
-module Jasmine
- class SpecBuilder
- def declare_spec(parent, spec)
- me = self
- example_name = spec["name"]
- @spec_ids << spec["id"]
- backtrace = @example_locations[parent.description + " " + example_name]
- parent.it example_name, {} do
- me.report_spec(spec["id"])
- end
- end
- end
-end
View
22 spec/javascripts/support/jasmine_reporter.js
@@ -1,22 +0,0 @@
-// don't include if we're running in jasmine-headless-webkit
-
-if(window.JHW === undefined) {
- var jsApiReporter;
- (function() {
- var jasmineEnv = jasmine.getEnv();
-
- jsApiReporter = new jasmine.JsApiReporter();
- var trivialReporter = new jasmine.TrivialReporter();
-
- jasmineEnv.addReporter(jsApiReporter);
- jasmineEnv.addReporter(trivialReporter);
-
- jasmineEnv.specFilter = function(spec) {
- return trivialReporter.specFilter(spec);
- };
-
- window.onload = function() {
- jasmineEnv.execute();
- };
- })();
-}
View
35 spec/javascripts/support/jasmine_runner.rb
@@ -1,35 +0,0 @@
-$:.unshift(ENV['JASMINE_GEM_PATH']) if ENV['JASMINE_GEM_PATH'] # for gem testing purposes
-
-require 'rubygems'
-require 'json'
-require 'jasmine'
-
-jasmine_config_overrides = File.expand_path(File.join(File.dirname(__FILE__), 'jasmine_config.rb'))
-require jasmine_config_overrides if File.exist?(jasmine_config_overrides)
-
-if Jasmine::Dependencies.rspec2?
- require 'rspec'
-else
- require 'spec'
-end
-
-jasmine_config = Jasmine::Config.new
-spec_builder = Jasmine::SpecBuilder.new(jasmine_config)
-
-should_stop = false
-
-if Jasmine::Dependencies.rspec2?
- RSpec.configuration.after(:suite) do
- spec_builder.stop if should_stop
- end
-else
- Spec::Runner.configure do |config|
- config.after(:suite) do
- spec_builder.stop if should_stop
- end
- end
-end
-
-spec_builder.start
-should_stop = true
-spec_builder.declare_suites
View
2,476 spec/javascripts/vendor/jasmine-1.1.0.js
@@ -1,2476 +0,0 @@
-var isCommonJS = typeof window == "undefined";
-
-/**
- * Top level namespace for Jasmine, a lightweight JavaScript BDD/spec/testing framework.
- *
- * @namespace
- */
-var jasmine = {};
-if (isCommonJS) exports.jasmine = jasmine;
-/**
- * @private
- */
-jasmine.unimplementedMethod_ = function() {
- throw new Error("unimplemented method");
-};
-
-/**
- * Use <code>jasmine.undefined</code> instead of <code>undefined</code>, since <code>undefined</code> is just
- * a plain old variable and may be redefined by somebody else.
- *
- * @private
- */
-jasmine.undefined = jasmine.___undefined___;
-
-/**
- * Show diagnostic messages in the console if set to true
- *
- */
-jasmine.VERBOSE = false;
-
-/**
- * Default interval in milliseconds for event loop yields (e.g. to allow network activity or to refresh the screen with the HTML-based runner). Small values here may result in slow test running. Zero means no updates until all tests have completed.
- *
- */
-jasmine.DEFAULT_UPDATE_INTERVAL = 250;
-
-/**
- * Default timeout interval in milliseconds for waitsFor() blocks.
- */
-jasmine.DEFAULT_TIMEOUT_INTERVAL = 5000;
-
-jasmine.getGlobal = function() {
- function getGlobal() {
- return this;
- }
-
- return getGlobal();
-};
-
-/**
- * Allows for bound functions to be compared. Internal use only.
- *
- * @ignore
- * @private
- * @param base {Object} bound 'this' for the function
- * @param name {Function} function to find
- */
-jasmine.bindOriginal_ = function(base, name) {
- var original = base[name];
- if (original.apply) {
- return function() {
- return original.apply(base, arguments);
- };
- } else {
- // IE support
- return jasmine.getGlobal()[name];
- }
-};
-
-jasmine.setTimeout = jasmine.bindOriginal_(jasmine.getGlobal(), 'setTimeout');
-jasmine.clearTimeout = jasmine.bindOriginal_(jasmine.getGlobal(), 'clearTimeout');
-jasmine.setInterval = jasmine.bindOriginal_(jasmine.getGlobal(), 'setInterval');
-jasmine.clearInterval = jasmine.bindOriginal_(jasmine.getGlobal(), 'clearInterval');
-
-jasmine.MessageResult = function(values) {
- this.type = 'log';
- this.values = values;
- this.trace = new Error(); // todo: test better
-};
-
-jasmine.MessageResult.prototype.toString = function() {
- var text = "";
- for (var i = 0; i < this.values.length; i++) {
- if (i > 0) text += " ";
- if (jasmine.isString_(this.values[i])) {
- text += this.values[i];
- } else {
- text += jasmine.pp(this.values[i]);
- }
- }
- return text;
-};
-
-jasmine.ExpectationResult = function(params) {
- this.type = 'expect';
- this.matcherName = params.matcherName;
- this.passed_ = params.passed;
- this.expected = params.expected;
- this.actual = params.actual;
- this.message = this.passed_ ? 'Passed.' : params.message;
-
- var trace = (params.trace || new Error(this.message));
- this.trace = this.passed_ ? '' : trace;
-};
-
-jasmine.ExpectationResult.prototype.toString = function () {
- return this.message;
-};
-
-jasmine.ExpectationResult.prototype.passed = function () {
- return this.passed_;
-};
-
-/**
- * Getter for the Jasmine environment. Ensures one gets created
- */
-jasmine.getEnv = function() {
- var env = jasmine.currentEnv_ = jasmine.currentEnv_ || new jasmine.Env();
- return env;
-};
-
-/**
- * @ignore
- * @private
- * @param value
- * @returns {Boolean}
- */
-jasmine.isArray_ = function(value) {
- return jasmine.isA_("Array", value);
-};
-
-/**
- * @ignore
- * @private
- * @param value
- * @returns {Boolean}
- */
-jasmine.isString_ = function(value) {
- return jasmine.isA_("String", value);
-};
-
-/**
- * @ignore
- * @private
- * @param value
- * @returns {Boolean}
- */
-jasmine.isNumber_ = function(value) {
- return jasmine.isA_("Number", value);
-};
-
-/**
- * @ignore
- * @private
- * @param {String} typeName
- * @param value
- * @returns {Boolean}
- */
-jasmine.isA_ = function(typeName, value) {
- return Object.prototype.toString.apply(value) === '[object ' + typeName + ']';
-};
-
-/**
- * Pretty printer for expecations. Takes any object and turns it into a human-readable string.
- *
- * @param value {Object} an object to be outputted
- * @returns {String}
- */
-jasmine.pp = function(value) {
- var stringPrettyPrinter = new jasmine.StringPrettyPrinter();
- stringPrettyPrinter.format(value);
- return stringPrettyPrinter.string;
-};
-
-/**
- * Returns true if the object is a DOM Node.
- *
- * @param {Object} obj object to check
- * @returns {Boolean}
- */
-jasmine.isDomNode = function(obj) {
- return obj.nodeType > 0;
-};
-