Permalink
Browse files

Rename to everqueen

  • Loading branch information...
1 parent e66fce8 commit 15f7854a65512606c123476e52f842cd53c9d2b3 @airhorns committed Dec 8, 2011
Showing with 216 additions and 265 deletions.
  1. +38 −78 README.rdoc
  2. +2 −2 bin/{everblue → everqueen}
  3. +1 −1 config/routes.rb
  4. +6 −6 everblue.gemspec → everqueen.gemspec
  5. +0 −29 lib/everblue/cli.rb
  6. +0 −14 lib/everblue/rails.rb
  7. +0 −32 lib/everblue/suite.rb
  8. +0 −17 lib/everblue/views/layout.erb
  9. +12 −12 lib/{everblue.rb → everqueen.rb}
  10. +5 −6 lib/{everblue → everqueen}/application.rb
  11. BIN lib/{everblue → everqueen}/assets/elabs.png
  12. 0 lib/{everblue/assets/everblue.scss.css → everqueen/assets/everqueen.scss.css}
  13. 0 lib/{everblue → everqueen}/assets/jquery.js
  14. 0 lib/{everblue → everqueen}/assets/json2.js
  15. +5 −5 lib/{everblue → everqueen}/assets/list.js.coffee
  16. +8 −8 lib/{everblue → everqueen}/assets/run.js.coffee.erb
  17. 0 lib/{everblue → everqueen}/assets/start.js.coffee
  18. 0 lib/{everblue → everqueen}/assets/test_helper.js
  19. +29 −0 lib/everqueen/cli.rb
  20. +14 −0 lib/everqueen/rails.rb
  21. +7 −7 lib/{everblue → everqueen}/runner.rb
  22. +3 −3 lib/{everblue → everqueen}/server.rb
  23. +32 −0 lib/everqueen/suite.rb
  24. +3 −3 lib/{everblue → everqueen}/tasks.rb
  25. +2 −2 lib/{everblue → everqueen}/test.rb
  26. +1 −1 lib/{everblue → everqueen}/version.rb
  27. 0 lib/{everblue → everqueen}/views/_test_error.erb
  28. +17 −0 lib/everqueen/views/layout.erb
  29. +1 −1 lib/{everblue → everqueen}/views/list.erb
  30. +1 −1 lib/{everblue → everqueen}/views/run.erb
  31. +0 −8 lib/tasks/everblue.rake
  32. +2 −2 lib/tasks/{evergreen.rake → everqueen.rake}
  33. +1 −1 spec/{everblue_spec.rb → everqueen_spec.rb}
  34. +5 −5 spec/meta_spec.rb
  35. +3 −3 spec/runner_spec.rb
  36. +9 −9 spec/spec_helper.rb
  37. +1 −1 spec/suite2/config/{everblue.rb → everqueen.rb}
  38. +3 −3 spec/suite_spec.rb
  39. +5 −5 spec/test_spec.rb
View
@@ -1,40 +1,39 @@
-= Everblue
+= Everqueen
-{<img src="http://travis-ci.org/jnicklas/everblue.png" />}[http://travis-ci.org/jnicklas/everblue]
+{<img src="http://travis-ci.org/hornairs/everqueen.png" />}[http://travis-ci.org/hornairs/everqueen]
-"Because green is the new Blue(Ridge)"
+"Because QUnit is just really simple."
-Everblue is a tool to run javascript unit tests for client side JavaScript. It
+Everqueen is a tool to run javascript unit tests for client side JavaScript. It
combines a server which allows you to serve up and run your tests in a browser,
as well as a runner which uses Capybara and any of its drivers to run your
-tests. Everblue uses the QUnit unit testing framework for JavaScript.
+tests. Everqueen uses the QUnit unit testing framework for JavaScript.
-http://github.com/hornairs/everblue
+http://github.com/hornairs/everqueen
+
+== Fork Note
+
+Everqueen is a serious fork of {Evergreen}[http://github.com/jnicklas/evergreen] by Jonas Nicklas.
+Evergreen rocks, but we wanted to use QUnit instead of Jasmine, and use Sprockets for serving up
+test files instead of the homebrew require system in Evergreen. Thank Jonas for his awesome
+OSS work on Evergreen, because he took us 99% of the way there.
== Philosophy
-Everblue is a unit testing tool. Its purpose is to test JavaScript in
+Everqueen is a unit testing tool. Its purpose is to test JavaScript in
isolation from your application. If you need a tool that tests how your
JavaScript integrates with your application you should use an integration
testing framework, such as {Capybara}[http://github.com/jnicklas/capybara].
-== Community
-
-Please ask questions on the {mailing
-list}[http://groups.google.com/group/ruby-everblue]. If you have found a
-reproducible error, please {file it on
-GitHub}[https://github.com/jnicklas/everblue/issues]. Do not contact the
-maintainers directly.
-
== Installation
Install as a Ruby gem:
- gem install everblue
+ gem install everqueen
== Usage
-Everblue assumes a file and directory structure, place all your javascript
+Everqueen assumes a file and directory structure, place all your javascript
code inside ./public and all test files inside ./test/javascripts. All test
files should end in _test.js. For example:
@@ -45,26 +44,26 @@ You can require files from the public directory inside your test file:
require('/javascripts/widget.js')
- describe('a widget', function() {
+ test('a widget', function() {
...
});
You can now look at your test files inside a browser by starting up the
-Everblue server:
+Everqueen server:
- everblue serve
+ everqueen serve
Alternatively you can run the tests headlessly by running:
- everblue run
+ everqueen run
== Integrating with Rails 3
-Add Everblue to your Gemfile:
+Add Everqueen to your Gemfile:
- gem 'everblue', :require => 'everblue/rails'
+ gem 'everqueen', :require => 'everqueen/rails'
-Start your rails application and navigate to /everblue. You should now see a
+Start your rails application and navigate to /everqueen. You should now see a
list of all test files, click on one to run it.
There's a rake task provided for you that you can use to run your tests:
@@ -75,73 +74,34 @@ There's a rake task provided for you that you can use to run your tests:
Add the following line to your Rakefile:
- require 'everblue/tasks'
+ require 'everqueen/tasks'
This will give you the `test:javascripts` rake task. Note that mounting is not
-possible under Rails 2 and that `require 'everblue/rails'` will fail.
+possible under Rails 2 and that `require 'everqueen/rails'` will fail.
== Configuration
-By default, Everblue uses Selenium to run your tests and assumes a certain
+By default, Everqueen uses Selenium to run your tests and assumes a certain
directory structure. If this standard is fine for you, then you don't need to
-do anything else. If you need to configure Everblue to suit your needs,
-Everblue will automatically look for and load the following files:
+do anything else. If you need to configure Everqueen to suit your needs,
+Everqueen will automatically look for and load the following files:
- config/everblue.rb
- .everblue
- ~/.everblue
+ config/everqueen.rb
+ .everqueen
+ ~/.everqueen
The content of these files could look like this:
require 'capybara-webkit'
- Everblue.configure do |config|
+ Everqueen.configure do |config|
config.driver = :webkit
config.public_dir = 'public_html'
- config.template_dir = 'templates'
config.test_dir = 'test'
end
-== Transactions
-
-One problem often faced when writing unit tests for client side code is that
-changes to the page are not reverted for the next example, so that successive
-examples become dependent on each other. Everblue adds a testial div to your
-page with an id of test. This div is automatically emptied before each example.
-You should avoid appending markup to the page body and instead append it to
-this test div:
-
- describe('transactions', function() {
- it("should add stuff in one test...", function() {
- $('#test').append('<h1 id="added">New Stuff</h1>');
- expect($('#test h1#added').length).toEqual(1);
- });
-
- it("... should have been removed before the next starts", function() {
- expect($('#test h1#added').length).toEqual(0);
- });
- });
-
-== Templates
-
-Even more powerful than that, Everblue allows you to create HTML templates to
-go along with your tests. Put the templates in their own folder like this:
-
- test/javascripts/templates/one_template.html
- test/javascripts/templates/another_template.html
-
-You can then load the template into the test div, by calling the template
-function in your tests:
-
- describe('transactions', function() {
- template('one_template.html')
-
- it("should load the template in this test", function() {
- ...
- });
- });
-== test Helper
+== Test Helper
If you add a test_helper file like so:
@@ -152,8 +112,8 @@ matchers and the like.
== CoffeeScript
-Everblue supports tests written in
-{CoffeeScript}[http://github.com/jashkenas/coffee-script]. Just name your test
+Everqueen supports tests written in
+{CoffeeScript}[http://github.com/jashkenas/coffee-script] via Sprockets. Just name your test
file _test.coffee and it will automatically be translated for you.
You can also add a CoffeeScript test helper, but remember that CoffeeScript
@@ -167,15 +127,15 @@ test helper to be available in your test files, attach it to the window object:
== Development
-If you plan to work on Everblue, you need to checkout the QUnit library, which
+If you plan to work on Everqueen, you need to checkout the QUnit library, which
is added as a git submodule. Run the following command:
git submodule update --init
-If you're using a version of Everblue from git with bundler, you need to tell
+If you're using a version of Everqueen from git with bundler, you need to tell
bundler to use submodules, this can be achieved with the following command:
- gem 'everblue', :submodules => true, :git => 'git://github.com/jnicklas/everblue.git'
+ gem 'everqueen', :submodules => true, :git => 'git://github.com/jnicklas/everqueen.git'
== License:
@@ -2,11 +2,11 @@
$:.unshift(File.dirname(__FILE__) + '/../lib') unless $:.include?(File.dirname(__FILE__) + '/../lib')
-require 'everblue'
+require 'everqueen'
begin
# The dup is to keep ARGV intact, so that tools like ruby-debug can respawn.
- success = Everblue::Cli.execute(ARGV.dup)
+ success = Everqueen::Cli.execute(ARGV.dup)
Kernel.exit(success ? 0 : 1)
rescue SystemExit => e
Kernel.exit(e.status)
View
@@ -1,3 +1,3 @@
Rails.application.routes.draw do
- mount Everblue::Application, :at => '/everblue'
+ mount Everqueen::Application, :at => '/everqueen'
end
@@ -2,22 +2,22 @@
lib = File.expand_path('../lib/', __FILE__)
$:.unshift lib unless $:.include?(lib)
-require 'everblue/version'
+require 'everqueen/version'
Gem::Specification.new do |s|
- s.name = "everblue"
- s.rubyforge_project = "everblue"
- s.version = Everblue::VERSION
+ s.name = "everqueen"
+ s.rubyforge_project = "everqueen"
+ s.version = Everqueen::VERSION
s.authors = ["Jonas Nicklas"]
s.email = ["jonas.nicklas@gmail.com"]
s.description = "Run Jasmine JavaScript unit tests, integrate them into Ruby applications."
s.files = Dir.glob("{bin,lib,spec,config}/**/*") + %w(README.rdoc)
s.extra_rdoc_files = ["README.rdoc"]
- s.executables = ['everblue']
+ s.executables = ['everqueen']
- s.homepage = "http://github.com/jnicklas/everblue"
+ s.homepage = "http://github.com/jnicklas/everqueen"
s.rdoc_options = ["--main", "README.rdoc"]
s.require_paths = ["lib"]
s.rubygems_version = "1.3.6"
View
@@ -1,29 +0,0 @@
-module Everblue
- class Cli
- def self.execute(argv)
- new.execute(argv)
- end
-
- def execute(argv)
- command = argv.shift
- Everblue.root = File.expand_path(argv.shift || '.', Dir.pwd)
-
- # detect Rails apps
- if File.exist?(File.join(Everblue.root, 'config/environment.rb'))
- require File.join(Everblue.root, 'config/environment.rb')
- require 'everblue/rails' if defined?(Rails)
- end
-
- case command
- when "serve"
- Everblue::Server.new.serve
- return true
- when "run"
- return Everblue::Runner.new.run
- else
- puts "no such command '#{command}'"
- return false
- end
- end
- end
-end
View
@@ -1,14 +0,0 @@
-require 'everblue'
-require 'rails'
-
-module Everblue
- if defined?(Rails::Engine)
- class Railtie < Rails::Engine
- initializer 'everblue.config' do
- Everblue.application = Rails.application
- Everblue.root = Rails.root
- Everblue.mounted_at = "/everblue"
- end
- end
- end
-end
View
@@ -1,32 +0,0 @@
-module Everblue
- class Suite
- attr_reader :driver
-
- def initialize
- paths = [
- File.expand_path("config/everblue.rb", root),
- File.expand_path(".everblue", root),
- "#{ENV["HOME"]}/.everblue"
- ]
- paths.each { |path| load(path) if File.exist?(path) }
- end
-
- def root
- Everblue.root
- end
-
- def mounted_at
- Everblue.mounted_at
- end
-
- def get_test(name)
- Test.new(self, name)
- end
-
- def tests
- Dir.glob(File.join(root, Everblue.test_dir, '**/*_test.{js,coffee}')).map do |path|
- Test.new(self, path.gsub(File.join(root, Everblue.test_dir, ''), ''))
- end
- end
- end
-end
@@ -1,17 +0,0 @@
-<!doctype html>
-
-<html>
- <head>
- <title>Everblue</title>
- <link rel="stylesheet" type="text/css" href="<%= url('/assets/everblue.css') %>"/>
- <meta http-equiv="content-type" content="text/html;charset=utf-8" />
- </head>
- <body>
- <%= yield %>
-
- <div id="footer">
- Powered by <a href="http://github.com/jnicklas/everblue">Everblue</a>.
- Everblue is sponsored by <a class="elabs" href="http://elabs.se"><img alt="Elabs" src="<%= url('/assets/elabs.png') %>"> Elabs</a>.
- </div>
- </body>
-</html>
@@ -3,16 +3,16 @@
require 'capybara'
require 'launchy'
require 'coffee-script'
-require 'everblue/version'
-require 'everblue/application'
+require 'everqueen/version'
+require 'everqueen/application'
require 'json'
-module Everblue
- autoload :Cli, 'everblue/cli'
- autoload :Server, 'everblue/server'
- autoload :Runner, 'everblue/runner'
- autoload :Suite, 'everblue/suite'
- autoload :Test, 'everblue/test'
+module Everqueen
+ autoload :Cli, 'everqueen/cli'
+ autoload :Server, 'everqueen/server'
+ autoload :Runner, 'everqueen/runner'
+ autoload :Suite, 'everqueen/suite'
+ autoload :Test, 'everqueen/test'
class << self
attr_accessor :driver, :public_dir, :test_dir, :root, :mounted_at, :application
@@ -23,7 +23,7 @@ def configure
def use_defaults!
configure do |config|
- config.application = Everblue::Application
+ config.application = Everqueen::Application
config.driver = :selenium
config.public_dir = 'public'
config.test_dir = 'test/javascripts'
@@ -54,13 +54,13 @@ def update_asset_paths(new_dir, old_dir)
return if root.nil?
old_dir = File.expand_path(old_dir, root)
new_dir = File.expand_path(new_dir, root)
- old_paths = Everblue::AssetsEnvironment.clear_paths
+ old_paths = Everqueen::AssetsEnvironment.clear_paths
old_paths.delete(old_dir)
old_paths.unshift(new_dir).each do |dir|
- Everblue::AssetsEnvironment.append_path(dir)
+ Everqueen::AssetsEnvironment.append_path(dir)
end
end
end
end
-Everblue.use_defaults!
+Everqueen.use_defaults!
Oops, something went wrong.

0 comments on commit 15f7854

Please sign in to comment.