Skip to content

[WIP] unittests with travis #66

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
language: ruby
rvm:
- 1.9.3
before_install:
- npm install -g grunt-cli
- git clone git://github.com/n1k0/casperjs.git ~/casperjs
- cd ~/casperjs
- git checkout tags/1.1-beta3
- export PATH=$PATH:`pwd`/bin
- cd -
before_script:
- npm install
- phantomjs --version
- casperjs --version

notifications:
email: false

script:
- bundle exec rake travis
- sleep 3
- npm test
27 changes: 27 additions & 0 deletions Gruntfile.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
'use strict';

module.exports = function(grunt) {
grunt.initConfig({
ghost: {
test: {
files: [{
src: ['tests/ghost/test_*.js']
}]
},
options: {
args: {
baseUrl: 'http://localhost:4000'
},
direct: false,
logLevel: 'error',
printCommand: false,
printFilePaths: true
}
}
});

grunt.loadNpmTasks('grunt-ghost');

grunt.registerTask('test', ['ghost']);
grunt.registerTask('default', ['ghost']);
};
5 changes: 5 additions & 0 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,11 @@ task :preview do
system "jekyll serve -w"
end # task :preview

desc "Launch travis environment"
task :travis do
system "jekyll serve --detach --port 4000"
end # task :travis

# Public: Alias - Maintains backwards compatability for theme switching.
task :switch_theme => "theme:switch"

Expand Down
2 changes: 1 addition & 1 deletion _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# For more see: https://github.com/mojombo/jekyll/wiki/Permalinks
permalink: /:categories/:year/:month/:day/:title

exclude: [".rvmrc", ".rbenv-version", "README.md", "Rakefile", "changelog.md"]
exclude: [".rvmrc", ".rbenv-version", "README.md", "Rakefile", "changelog.md","vendor"]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what does this vendor directory contain?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this we need to fix the building error

bundle exec rake travis or easier bundle exec jekyll serve --detach --port 4000

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Question is, if we can get rid of this change when we killed grunt and npm? I would like to know who (which script) creates this dir

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sry for write this unclear.

this directory will create by bundle install --deployment

Generating... Error reading file /home/travis/build/ClemensSahs/phpughh.github.com/vendor/bundle/ruby/1.9.1/gems/RedCloth-4.2.9/spec/fixtures/lists.yml: Don't know how to add to a NilClass!

This we need to build the the page with jekyll serve.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah ok, right. Then it have to stay obviously 🐳

pygments: true

# Themes are encouraged to use these universal variables
Expand Down
11 changes: 11 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"scripts": {
"test": "grunt test"
},
"dependencies": {},
"devDependencies": {
"grunt": "0.4.1",
"grunt-contrib-connect": "0.2.0",
"grunt-ghost": "1.0.8"
}
}
16 changes: 16 additions & 0 deletions tests/ghost/test_meetup.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
casper.options.logLevel = "error";
casper.options.verbose = false;

casper.test.begin('check meetup widget', function suite(test) {
casper

.start('http://127.0.0.1:4000/index.html')

.then(function() {
test.assertExists('.next');
})

.run(function() {
test.done();
});
});