tuev 0.5.1 → 0.6.2
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile.lock +1 -1
- data/Rakefile +25 -0
- data/VERSION +1 -1
- data/bin/tuev +5 -0
- data/lib/tuev/tuev_runner.rb +40 -10
- data/spec/qunit_runner_spec.rb +8 -0
- data/tuev.gemspec +2 -2
- metadata +3 -3
data/Gemfile.lock
CHANGED
data/Rakefile
CHANGED
@@ -30,6 +30,31 @@ Jeweler::Tasks.new do |gem|
|
|
30
30
|
end
|
31
31
|
Jeweler::RubygemsDotOrgTasks.new
|
32
32
|
|
33
|
+
gemspec = 'tuev.gemspec'
|
34
|
+
|
35
|
+
namespace :gem do
|
36
|
+
desc "Release a new version of the gem to the soundcloud repo"
|
37
|
+
task :screlease => [ 'version:bump:patch', 'gemspec', :deploy ]
|
38
|
+
|
39
|
+
desc "Deploys the built gem to the soundcloud gem repository: gems.soundcloud.com"
|
40
|
+
task :deploy do
|
41
|
+
Dir.chdir File.dirname(__FILE__)
|
42
|
+
spec = eval(IO.read(gemspec))
|
43
|
+
version = spec.version.to_s
|
44
|
+
raise "Version #{version} already deployed" if `git fetch --tags && git tag`.split(/\n/).include?(version)
|
45
|
+
sh <<-END
|
46
|
+
git commit -a --allow-empty -m 'Bump version to #{version}'
|
47
|
+
git tag -a #{version} -m 'Version #{version}'
|
48
|
+
git push
|
49
|
+
git push --tags
|
50
|
+
gem build #{gemspec} &&\
|
51
|
+
scp #{spec.file_name} soundcloud@gems.int.s-cloud.net:/srv/www/gems/gems &&\
|
52
|
+
ssh soundcloud@gems.int.s-cloud.net 'gem generate_index -d /srv/www/gems' &&\
|
53
|
+
rm #{spec.file_name}
|
54
|
+
END
|
55
|
+
end
|
56
|
+
end
|
57
|
+
|
33
58
|
require 'rake/testtask'
|
34
59
|
Rake::TestTask.new(:spec) do |spec|
|
35
60
|
spec.libs << 'lib' << 'spec'
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.
|
1
|
+
0.6.2
|
data/bin/tuev
CHANGED
@@ -29,6 +29,11 @@ opts = OptionParser.new do |opts|
|
|
29
29
|
options[:port] = port || options[:port]
|
30
30
|
end
|
31
31
|
|
32
|
+
opts.on("-w", "--wait=SECONDS",
|
33
|
+
"do a wait after each test") do |port|
|
34
|
+
options[:port] = port || options[:port]
|
35
|
+
end
|
36
|
+
|
32
37
|
# List of arguments.
|
33
38
|
opts.on("-b", "--browsers=x,y,z", Array,
|
34
39
|
"browsers where to run this file in (default #{options[:browsers].join(",")})") do |browsers|
|
data/lib/tuev/tuev_runner.rb
CHANGED
@@ -62,24 +62,54 @@ class QunitRunner
|
|
62
62
|
|
63
63
|
@selenium_conf[:browsers].each do |browser_id|
|
64
64
|
run_in_browser(browser_id) do |browser|
|
65
|
+
test_framework = ""
|
66
|
+
|
65
67
|
browser.open path
|
66
68
|
browser.wait_for_page_to_load "60000"
|
67
69
|
puts "\ntesting on #{browser_id}: #{@test_file}\n\n"
|
68
|
-
|
70
|
+
120.times{
|
71
|
+
if (browser.get_text("css=.jasmine_reporter") rescue false)
|
72
|
+
test_framework = "jasmine"
|
73
|
+
break
|
74
|
+
end
|
75
|
+
|
76
|
+
if (browser.get_text('id=qunit-testresult') != "Running..." rescue false)
|
77
|
+
test_framework = "qunit"
|
78
|
+
break
|
79
|
+
end
|
80
|
+
|
81
|
+
sleep 1
|
82
|
+
}
|
83
|
+
|
69
84
|
sleep 1
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
85
|
+
|
86
|
+
output =""
|
87
|
+
num_of_errors = 0
|
88
|
+
if test_framework == "qunit"
|
89
|
+
if browser.get_eval("typeof(window.results)") == "undefined"
|
90
|
+
$stderr.puts "\tINFO: some lines of javascript will give you detailed testing output. For more info, see:"
|
91
|
+
$stderr.puts "\thttps://github.com/kesselborn/tuev/raw/master/contrib/tuev_qunit.js"
|
92
|
+
$stderr.puts
|
93
|
+
else
|
94
|
+
puts browser.get_eval('window.results.join("\n")')
|
95
|
+
errors += browser.get_eval('window.errors.join("\n")')
|
96
|
+
end
|
97
|
+
|
98
|
+
output = browser.get_text('id=qunit-testresult')
|
99
|
+
num_of_errors += browser.get_text("css=#qunit-testresult .failed").to_i
|
74
100
|
else
|
75
|
-
|
76
|
-
|
101
|
+
output = browser.get_eval('window.message')
|
102
|
+
junit_output = browser.get_eval('window.junitXML')
|
103
|
+
File.open("junit_results.xml", "w") do |f|
|
104
|
+
f << junit_output
|
105
|
+
end
|
106
|
+
num_of_errors += browser.get_eval('window.isSuccess') ? 0 : 1
|
77
107
|
end
|
78
108
|
|
79
|
-
|
80
|
-
puts browser.get_text('id=qunit-testresult')
|
109
|
+
puts output
|
81
110
|
puts
|
82
|
-
|
111
|
+
|
112
|
+
num_of_errors
|
83
113
|
end
|
84
114
|
end
|
85
115
|
|
data/spec/qunit_runner_spec.rb
CHANGED
@@ -10,6 +10,14 @@ describe "QunitRunner" do
|
|
10
10
|
end
|
11
11
|
|
12
12
|
it "should detect the base host correctly" do
|
13
|
+
QunitRunner.new("http://example.com:1234", "").host.should == "http://example.com:1234"
|
14
|
+
QunitRunner.new("http://example.com:1234/", "").host.should == "http://example.com:1234"
|
15
|
+
QunitRunner.new("http://example.com:1234/lirumlarum", "").host.should == "http://example.com:1234"
|
16
|
+
|
17
|
+
QunitRunner.new("https://example.com:1234", "").host.should == "https://example.com:1234"
|
18
|
+
QunitRunner.new("https://example.com:1234/", "").host.should == "https://example.com:1234"
|
19
|
+
QunitRunner.new("https://example.com:1234/lirumlarum", "").host.should == "https://example.com:1234"
|
20
|
+
|
13
21
|
QunitRunner.new("http://example.com", "").host.should == "http://example.com"
|
14
22
|
QunitRunner.new("http://example.com/", "").host.should == "http://example.com"
|
15
23
|
QunitRunner.new("http://example.com/lirumlarum", "").host.should == "http://example.com"
|
data/tuev.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{tuev}
|
8
|
-
s.version = "0.
|
8
|
+
s.version = "0.6.2"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["kesselborn"]
|
12
|
-
s.date = %q{2011-
|
12
|
+
s.date = %q{2011-12-20}
|
13
13
|
s.default_executable = %q{tuev}
|
14
14
|
s.description = %q{...}
|
15
15
|
s.email = %q{daniel@soundcloud.com}
|
metadata
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
name: tuev
|
3
3
|
version: !ruby/object:Gem::Version
|
4
4
|
prerelease:
|
5
|
-
version: 0.
|
5
|
+
version: 0.6.2
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- kesselborn
|
@@ -10,7 +10,7 @@ autorequire:
|
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
12
|
|
13
|
-
date: 2011-
|
13
|
+
date: 2011-12-20 00:00:00 +01:00
|
14
14
|
default_executable: tuev
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
@@ -154,7 +154,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
154
154
|
requirements:
|
155
155
|
- - ">="
|
156
156
|
- !ruby/object:Gem::Version
|
157
|
-
hash:
|
157
|
+
hash: 3854787198987103234
|
158
158
|
segments:
|
159
159
|
- 0
|
160
160
|
version: "0"
|