tuev 0.3.2
Sign up to get free protection for your applications and to get access to all the features.
- data/.document +5 -0
- data/.gitmodules +6 -0
- data/.rvmrc +1 -0
- data/Gemfile +19 -0
- data/Gemfile.lock +32 -0
- data/LICENSE.txt +20 -0
- data/README.md +75 -0
- data/Rakefile +50 -0
- data/VERSION +1 -0
- data/bin/tuev +85 -0
- data/contrib/jquery-1.5.1.js +8316 -0
- data/contrib/mockjax/jquery.mockjax.js +382 -0
- data/contrib/qunit/qunit/qunit.css +215 -0
- data/contrib/qunit/qunit/qunit.js +1442 -0
- data/contrib/test_default.html +88 -0
- data/contrib/tuev.yml +37 -0
- data/contrib/tuev_helper.rb +70 -0
- data/contrib/tuev_qunit.js +23 -0
- data/lib/tasks/tuev.rake +112 -0
- data/lib/tuev/tuev.rb +116 -0
- data/lib/tuev/tuev_runner.rb +64 -0
- data/lib/tuev.rb +15 -0
- data/spec/fixtures/fake_root/config/tuev.yml +39 -0
- data/spec/fixtures/file_layout1.txt +13 -0
- data/spec/spec_helper.rb +17 -0
- data/spec/tuev_spec.rb +7 -0
- data/tuev.gemspec +94 -0
- data/tuev_helper.rb +11 -0
- metadata +175 -0
data/.document
ADDED
data/.gitmodules
ADDED
data/.rvmrc
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
rvm use --create 1.9.2@tuev
|
data/Gemfile
ADDED
@@ -0,0 +1,19 @@
|
|
1
|
+
source "http://rubygems.org"
|
2
|
+
# Add dependencies required to use your gem here.
|
3
|
+
# Example:
|
4
|
+
# gem "activesupport", ">= 2.3.5"
|
5
|
+
|
6
|
+
# Add dependencies to develop your gem here.
|
7
|
+
# Include everything needed to run rake, tests, features, etc.
|
8
|
+
#
|
9
|
+
gem "selenium-client"
|
10
|
+
|
11
|
+
group :development do
|
12
|
+
gem "rake"
|
13
|
+
gem "tuev", :path => "."
|
14
|
+
gem "bacon", ">= 0"
|
15
|
+
gem "yard", "~> 0.6.0"
|
16
|
+
gem "bundler", "~> 1.0.0"
|
17
|
+
gem "jeweler", "~> 1.5.2"
|
18
|
+
gem "rcov", ">= 0"
|
19
|
+
end
|
data/Gemfile.lock
ADDED
@@ -0,0 +1,32 @@
|
|
1
|
+
PATH
|
2
|
+
remote: .
|
3
|
+
specs:
|
4
|
+
tuev (0.3.2)
|
5
|
+
selenium-client
|
6
|
+
|
7
|
+
GEM
|
8
|
+
remote: http://rubygems.org/
|
9
|
+
specs:
|
10
|
+
bacon (1.1.0)
|
11
|
+
git (1.2.5)
|
12
|
+
jeweler (1.5.2)
|
13
|
+
bundler (~> 1.0.0)
|
14
|
+
git (>= 1.2.5)
|
15
|
+
rake
|
16
|
+
rake (0.8.7)
|
17
|
+
rcov (0.9.9)
|
18
|
+
selenium-client (1.2.18)
|
19
|
+
yard (0.6.5)
|
20
|
+
|
21
|
+
PLATFORMS
|
22
|
+
ruby
|
23
|
+
|
24
|
+
DEPENDENCIES
|
25
|
+
bacon
|
26
|
+
bundler (~> 1.0.0)
|
27
|
+
jeweler (~> 1.5.2)
|
28
|
+
rake
|
29
|
+
rcov
|
30
|
+
selenium-client
|
31
|
+
tuev!
|
32
|
+
yard (~> 0.6.0)
|
data/LICENSE.txt
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
Copyright (c) 2011 kesselborn
|
2
|
+
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
4
|
+
a copy of this software and associated documentation files (the
|
5
|
+
"Software"), to deal in the Software without restriction, including
|
6
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
7
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
8
|
+
permit persons to whom the Software is furnished to do so, subject to
|
9
|
+
the following conditions:
|
10
|
+
|
11
|
+
The above copyright notice and this permission notice shall be
|
12
|
+
included in all copies or substantial portions of the Software.
|
13
|
+
|
14
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
15
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
16
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
17
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
18
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
19
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
20
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,75 @@
|
|
1
|
+
tuev
|
2
|
+
====
|
3
|
+
|
4
|
+
In a nutshell
|
5
|
+
-------------
|
6
|
+
tuev is a little helper program that makes it easy to run qunit-tests using
|
7
|
+
Seleinum.
|
8
|
+
|
9
|
+
Why do you want this?
|
10
|
+
---------------------
|
11
|
+
It makes it possible to start qunit test from a script and evaluate by the
|
12
|
+
return code whether tests pass or not. Combine it with ... and you have
|
13
|
+
CI-able testing for qunit tests
|
14
|
+
|
15
|
+
Kickstart
|
16
|
+
=========
|
17
|
+
### Basic installation
|
18
|
+
|
19
|
+
Install gem with
|
20
|
+
|
21
|
+
gem install tuev
|
22
|
+
|
23
|
+
or, if you use bundler for your project, add the line
|
24
|
+
|
25
|
+
gem 'tuev'
|
26
|
+
|
27
|
+
to your Gemfile.
|
28
|
+
|
29
|
+
### Rakefile integration
|
30
|
+
|
31
|
+
If you want to use tuev's rake tasks, add
|
32
|
+
|
33
|
+
require 'bundler/setup' # if you use bundler
|
34
|
+
require 'tuev'
|
35
|
+
|
36
|
+
to your Rakefile and call
|
37
|
+
|
38
|
+
rake -T
|
39
|
+
|
40
|
+
to get a list of available options. The first thing you want to run is
|
41
|
+
|
42
|
+
rake tuev:prepare
|
43
|
+
|
44
|
+
|
45
|
+
Usage
|
46
|
+
=====
|
47
|
+
Command line utility
|
48
|
+
--------------------
|
49
|
+
Call
|
50
|
+
|
51
|
+
tuev <qunit-html-file>
|
52
|
+
|
53
|
+
for more info, call
|
54
|
+
|
55
|
+
tuev -h
|
56
|
+
|
57
|
+
Rake tasks
|
58
|
+
----------
|
59
|
+
|
60
|
+
|
61
|
+
Contributing to tuev
|
62
|
+
--------------------
|
63
|
+
* Check out the latest master to make sure the feature hasn't been implemented or the bug hasn't been fixed yet
|
64
|
+
* Check out the issue tracker to make sure someone already hasn't requested it and/or contributed it
|
65
|
+
* Fork the project
|
66
|
+
* Start a feature/bugfix branch
|
67
|
+
* Commit and push until you are happy with your contribution
|
68
|
+
* Make sure to add tests for it. This is important so I don't break it in a future version unintentionally.
|
69
|
+
* Please try not to mess with the Rakefile, version, or history. If you want to have your own version, or is otherwise necessary, that is fine, but please isolate to its own commit so I can cherry-pick around it.
|
70
|
+
|
71
|
+
== Copyright
|
72
|
+
|
73
|
+
Copyright (c) 2011 kesselborn. See LICENSE.txt for
|
74
|
+
further details.
|
75
|
+
|
data/Rakefile
ADDED
@@ -0,0 +1,50 @@
|
|
1
|
+
require 'rubygems'
|
2
|
+
require 'bundler'
|
3
|
+
begin
|
4
|
+
Bundler.setup(:default, :development)
|
5
|
+
rescue Bundler::BundlerError => e
|
6
|
+
$stderr.puts e.message
|
7
|
+
$stderr.puts "Run `bundle install` to install missing gems"
|
8
|
+
exit e.status_code
|
9
|
+
end
|
10
|
+
require 'rake'
|
11
|
+
|
12
|
+
require 'jeweler'
|
13
|
+
Jeweler::Tasks.new do |gem|
|
14
|
+
# gem is a Gem::Specification... see http://docs.rubygems.org/read/chapter/20 for more options
|
15
|
+
gem.name = "tuev"
|
16
|
+
gem.homepage = "http://github.com/kesselborn/tuev"
|
17
|
+
gem.license = "MIT"
|
18
|
+
gem.summary = %Q{run qunit & selenium tests with rake}
|
19
|
+
gem.description = %Q{...}
|
20
|
+
gem.email = "daniel@soundcloud.com"
|
21
|
+
gem.authors = ["kesselborn"]
|
22
|
+
gem.executables = ["tuev"]
|
23
|
+
gem.files.include "contrib/qunit/qunit/qunit.css"
|
24
|
+
gem.files.include "contrib/qunit/qunit/qunit.js"
|
25
|
+
gem.files.include "contrib/mockjax/jquery.mockjax.js"
|
26
|
+
# Include your dependencies below. Runtime dependencies are required when using your gem,
|
27
|
+
# and development dependencies are only needed for development (ie running rake tasks, tests, etc)
|
28
|
+
# gem.add_runtime_dependency 'jabber4r', '> 0.1'
|
29
|
+
# gem.add_development_dependency 'rspec', '> 1.2.3'
|
30
|
+
end
|
31
|
+
Jeweler::RubygemsDotOrgTasks.new
|
32
|
+
|
33
|
+
require 'rake/testtask'
|
34
|
+
Rake::TestTask.new(:spec) do |spec|
|
35
|
+
spec.libs << 'lib' << 'spec'
|
36
|
+
spec.pattern = 'spec/**/*_spec.rb'
|
37
|
+
spec.verbose = true
|
38
|
+
end
|
39
|
+
|
40
|
+
require 'rcov/rcovtask'
|
41
|
+
Rcov::RcovTask.new do |spec|
|
42
|
+
spec.libs << 'spec'
|
43
|
+
spec.pattern = 'spec/**/*_spec.rb'
|
44
|
+
spec.verbose = true
|
45
|
+
end
|
46
|
+
|
47
|
+
task :default => :spec
|
48
|
+
|
49
|
+
require 'yard'
|
50
|
+
YARD::Rake::YardocTask.new
|
data/VERSION
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
0.3.2
|
data/bin/tuev
ADDED
@@ -0,0 +1,85 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
require 'optparse'
|
3
|
+
require 'ostruct'
|
4
|
+
require File.expand_path("../../lib/tuev/tuev_runner.rb", __FILE__)
|
5
|
+
|
6
|
+
options = {}
|
7
|
+
|
8
|
+
opts = OptionParser.new do |opts|
|
9
|
+
opts.banner = "Usage: tuev [options] <qunit html files>"
|
10
|
+
|
11
|
+
opts.separator ""
|
12
|
+
opts.separator "Specific options:"
|
13
|
+
|
14
|
+
options = {
|
15
|
+
:host => 'localhost',
|
16
|
+
:port => '4444',
|
17
|
+
:browsers => ['*firefox'],
|
18
|
+
:timeout => 15
|
19
|
+
}
|
20
|
+
|
21
|
+
opts.on("-h", "--host=HOST",
|
22
|
+
"set selenium host (default: #{options[:host]})") do |host|
|
23
|
+
options[:host] = host || options[:host]
|
24
|
+
end
|
25
|
+
|
26
|
+
# Optional argument; multi-line description.
|
27
|
+
opts.on("-p", "--port=PORT",
|
28
|
+
"set selenium host's port (default: #{options[:port]})") do |port|
|
29
|
+
options[:port] = port || options[:port]
|
30
|
+
end
|
31
|
+
|
32
|
+
# List of arguments.
|
33
|
+
opts.on("-b", "--browsers=x,y,z", Array,
|
34
|
+
"browsers where to run this file in (default #{options[:browsers].join(",")})") do |browsers|
|
35
|
+
options[:browsers] = browsers || options[:browsers]
|
36
|
+
end
|
37
|
+
|
38
|
+
opts.on("-t", "--timeout=TIMEOUT",
|
39
|
+
"default timeout that selenium waits before it throws a timeout error (default: #{options[:timeout]})") do |timeout|
|
40
|
+
options[:timeout] = timeout || options[:timeout]
|
41
|
+
end
|
42
|
+
|
43
|
+
|
44
|
+
# No argument, shows at tail. This will print an options summary.
|
45
|
+
# Try it and see!
|
46
|
+
opts.on_tail("-h", "--help", "Show this message") do
|
47
|
+
puts opts
|
48
|
+
exit
|
49
|
+
end
|
50
|
+
|
51
|
+
# Another typical switch to print the version.
|
52
|
+
opts.on_tail("--version", "Show version") do
|
53
|
+
puts File.read(File.expand_path("../../VERSION", __FILE__))
|
54
|
+
exit
|
55
|
+
end
|
56
|
+
end
|
57
|
+
|
58
|
+
begin
|
59
|
+
opts.parse!(ARGV)
|
60
|
+
rescue => e
|
61
|
+
if e.is_a?(OptionParser::MissingArgument) && e.args[0] == "-h"
|
62
|
+
print opts
|
63
|
+
exit
|
64
|
+
end
|
65
|
+
end
|
66
|
+
|
67
|
+
qunit_files = ARGV
|
68
|
+
|
69
|
+
if qunit_files.empty?
|
70
|
+
puts ""
|
71
|
+
puts "ERROR: no test files given!"
|
72
|
+
puts ""
|
73
|
+
puts opts
|
74
|
+
exit(1)
|
75
|
+
end
|
76
|
+
|
77
|
+
errors = 0
|
78
|
+
qunit_files.each do |file|
|
79
|
+
path = File.expand_path(file)
|
80
|
+
errors += QunitRunner.new(path, options).run
|
81
|
+
end
|
82
|
+
|
83
|
+
exit(errors)
|
84
|
+
|
85
|
+
#vim:ft=ruby
|