Skip to content

Commit

Permalink
Created a blank js using casperjs project.
Browse files Browse the repository at this point in the history
  • Loading branch information
stas committed Oct 27, 2013
1 parent 3fe03af commit b909282
Show file tree
Hide file tree
Showing 8 changed files with 1,037 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.sass-cache
5 changes: 5 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
source :rubygems

gem 'casperjs'
gem 'guard-casper', :github => 'davidsevcik/guard-casper'
gem 'rb-inotify'
30 changes: 30 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
GIT
remote: git://github.com/davidsevcik/guard-casper.git
revision: 146fc57a7ea31185a0ec2c8ce768719d23b2fbf0
specs:
guard-casper (0.1.1)
childprocess
guard (>= 0.8.3)

GEM
remote: http://rubygems.org/
specs:
casperjs (1.0.0.RC1)
childprocess (0.3.5)
ffi (~> 1.0, >= 1.0.6)
ffi (1.1.5)
guard (1.3.2)
listen (>= 0.4.2)
thor (>= 0.14.6)
listen (0.5.0)
rb-inotify (0.8.8)
ffi (>= 0.5.0)
thor (0.16.0)

PLATFORMS
ruby

DEPENDENCIES
casperjs
guard-casper!
rb-inotify
10 changes: 10 additions & 0 deletions Guardfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# A sample Guardfile
# More info at https://github.com/guard/guard#readme

guard 'casper' do
watch(%r{scenario/scenario\.(js\.coffee|js|coffee)$}) { "scenario" }
watch(%r{scenario/.+_scenario\.(js\.coffee|js|coffee)$})
watch(%r{src/(.+?)\.(js\.coffee|js|coffee)$}) { |m|
"scenario/#{m[1]}_scenario.#{m[2]}"
}
end
916 changes: 916 additions & 0 deletions css/foundation.css

Large diffs are not rendered by default.

57 changes: 57 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
<!DOCTYPE html>
<html class="no-js" lang="en">
<head>
<meta charset="utf-8" />

<!-- Set the viewport width to device width for mobile -->
<meta name="viewport" content="width=device-width" />

<title>Quiz Builder</title>

<link rel="stylesheet" href="css/foundation.css">
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.8.1/jquery.min.js"></script>
<script src="src/quiz_builder.js"></script>

<!-- IE Fix for HTML5 Tags -->
<!--[if lt IE 9]>
<script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->

</head>
<body>

<div class="row">
<div class="twelve columns">
<h2>Quiz Builder, part of Courseware Project</h2>
<p>This is version <strong>0.1</strong>.</p>
<hr />
</div>
</div>

<div class="row">
<div class="eight columns">
<h3>Start Here</h3>

<div class="row">
<div class="twelve columns">

<div id="demo"></div>

</div>
</div>

</div>

<div class="four columns">
<h4>Dependencies</h4>
<p>Quiz Builder requires jQuery 1.8.1 or higher</p>

<h4>Other Resources</h4>
<ul class="disc">
<li><a href="http://github.com/stas/quiz_builder">Quiz Builder on Github</a><br />Latest code, issue reports, feature requests and more.</li>
</ul>
</div>
</div>

</body>
</html>
17 changes: 17 additions & 0 deletions scenario/quiz_builder_scenario.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
var casper = require('casper').create();

casper.start('index.html', function() {
this.test.assertTitle('Quiz Builder');
this.test.assertExists('div[id="demo"]');
});

casper.then(function() {
this.test.assertTitle('Quiz Builder');
this.test.assertEval(function() {
return __utils__.findAll('h2').length == 1;
});
});

casper.run(function() {
this.test.renderResults(true);
});
1 change: 1 addition & 0 deletions src/quiz_builder.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
var QuizBuilder = {};

0 comments on commit b909282

Please sign in to comment.