celerity 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- data/History.txt +10 -0
- data/README.txt +8 -11
- data/Rakefile +5 -3
- data/benchmark/bm_2000_spans.rb +48 -0
- data/benchmark/bm_digg.rb +26 -0
- data/benchmark/bm_google_images.rb +36 -0
- data/benchmark/bm_input_locator.rb +69 -0
- data/benchmark/loader.rb +9 -0
- data/lib/celerity.rb +3 -1
- data/lib/celerity/container.rb +23 -171
- data/lib/celerity/disabled_element.rb +1 -1
- data/lib/celerity/element.rb +78 -47
- data/lib/celerity/element_collections.rb +16 -32
- data/lib/celerity/element_locator.rb +135 -0
- data/lib/celerity/elements/button.rb +15 -0
- data/lib/celerity/elements/file_field.rb +1 -1
- data/lib/celerity/elements/form.rb +2 -1
- data/lib/celerity/elements/frame.rb +18 -21
- data/lib/celerity/elements/image.rb +2 -8
- data/lib/celerity/elements/label.rb +1 -3
- data/lib/celerity/elements/link.rb +1 -1
- data/lib/celerity/elements/option.rb +16 -0
- data/lib/celerity/elements/radio_check.rb +18 -7
- data/lib/celerity/elements/select_list.rb +1 -17
- data/lib/celerity/elements/table.rb +4 -4
- data/lib/celerity/elements/table_body.rb +6 -8
- data/lib/celerity/elements/table_cell.rb +3 -14
- data/lib/celerity/elements/table_row.rb +4 -10
- data/lib/celerity/elements/text_field.rb +16 -4
- data/lib/celerity/extra/method_generator.rb +144 -0
- data/lib/celerity/identifier.rb +10 -0
- data/lib/celerity/ie.rb +28 -13
- data/lib/celerity/input_element.rb +0 -4
- data/lib/celerity/non_control_elements.rb +12 -12
- data/lib/celerity/version.rb +1 -1
- data/spec/area_spec.rb +41 -41
- data/spec/areas_spec.rb +11 -11
- data/spec/button_spec.rb +73 -68
- data/spec/buttons_spec.rb +10 -10
- data/spec/checkbox_spec.rb +102 -96
- data/spec/checkboxes_spec.rb +10 -10
- data/spec/div_spec.rb +78 -73
- data/spec/divs_spec.rb +10 -10
- data/spec/element_spec.rb +20 -11
- data/spec/filefield_spec.rb +36 -41
- data/spec/filefields_spec.rb +10 -10
- data/spec/form_spec.rb +29 -29
- data/spec/forms_spec.rb +11 -11
- data/spec/frame_spec.rb +54 -49
- data/spec/hidden_spec.rb +43 -43
- data/spec/hiddens_spec.rb +10 -10
- data/spec/html/2000_spans.html +2009 -0
- data/spec/html/forms_with_input_elements.html +15 -9
- data/spec/html/non_control_elements.html +4 -2
- data/spec/ie_spec.rb +82 -48
- data/spec/image_spec.rb +83 -100
- data/spec/images_spec.rb +10 -10
- data/spec/label_spec.rb +29 -29
- data/spec/labels_spec.rb +10 -10
- data/spec/li_spec.rb +41 -41
- data/spec/link_spec.rb +65 -59
- data/spec/links_spec.rb +11 -11
- data/spec/lis_spec.rb +10 -10
- data/spec/map_spec.rb +30 -30
- data/spec/maps_spec.rb +10 -10
- data/spec/p_spec.rb +49 -49
- data/spec/pre_spec.rb +41 -41
- data/spec/pres_spec.rb +10 -10
- data/spec/ps_spec.rb +10 -10
- data/spec/radio_spec.rb +104 -97
- data/spec/radios_spec.rb +11 -11
- data/spec/select_list_spec.rb +118 -106
- data/spec/select_lists_spec.rb +15 -15
- data/spec/span_spec.rb +54 -54
- data/spec/spans_spec.rb +11 -11
- data/spec/spec.opts +1 -1
- data/spec/spec_helper.rb +23 -3
- data/spec/table_bodies.rb +8 -8
- data/spec/table_bodies_spec.rb +9 -9
- data/spec/table_body_spec.rb +28 -27
- data/spec/table_cell_spec.rb +25 -25
- data/spec/table_cells_spec.rb +16 -16
- data/spec/table_row_spec.rb +16 -16
- data/spec/table_rows_spec.rb +12 -12
- data/spec/table_spec.rb +36 -36
- data/spec/tables_spec.rb +12 -12
- data/spec/text_field_spec.rb +111 -92
- data/spec/text_fields_spec.rb +13 -13
- data/tasks/benchmark.rake +3 -0
- data/tasks/rspec.rake +2 -2
- data/tasks/testserver.rake +15 -0
- metadata +58 -46
- data/tasks/simple_ci.rake +0 -94
data/tasks/simple_ci.rake
DELETED
@@ -1,94 +0,0 @@
|
|
1
|
-
require "rubygems"
|
2
|
-
require "fileutils"
|
3
|
-
require "erb"
|
4
|
-
require "pp"
|
5
|
-
|
6
|
-
begin
|
7
|
-
require "mongrel"
|
8
|
-
rescue LoadError
|
9
|
-
end
|
10
|
-
|
11
|
-
task :simple_ci do
|
12
|
-
INTERVAL = (60*5)
|
13
|
-
CI_ROOT = File.dirname(__FILE__) + "/../simple_ci"
|
14
|
-
ROOT = File.expand_path(CI_ROOT + "/..")
|
15
|
-
Dir.mkdir(CI_ROOT) unless File.exist?(CI_ROOT)
|
16
|
-
|
17
|
-
class SpecFile < Struct.new(:file, :describes)
|
18
|
-
attr_accessor :passed
|
19
|
-
end
|
20
|
-
|
21
|
-
def get_specs
|
22
|
-
Dir[File.dirname(__FILE__) + '/../spec/**/*_spec.rb'].map do |file|
|
23
|
-
SpecFile.new(file, File.read(file)[/describe\(?\s*["'](.+?)["']/, 1] || File.basename(file) )
|
24
|
-
end
|
25
|
-
end
|
26
|
-
|
27
|
-
class SimpleCI < Mongrel::HttpHandler
|
28
|
-
def self.template=(rhtml); @@template = rhtml; end
|
29
|
-
|
30
|
-
def initialize(results)
|
31
|
-
@results = results
|
32
|
-
super()
|
33
|
-
end
|
34
|
-
|
35
|
-
def process(request, response)
|
36
|
-
response.start(200) do |header, io|
|
37
|
-
if @results
|
38
|
-
io.write ERB.new(@@template).result
|
39
|
-
end
|
40
|
-
end
|
41
|
-
end
|
42
|
-
|
43
|
-
end
|
44
|
-
|
45
|
-
@results = {}
|
46
|
-
SimpleCI.template = <<-HTML
|
47
|
-
<html>
|
48
|
-
<head>
|
49
|
-
<meta http-equiv="Content-type" content="text/html; charset=utf-8">
|
50
|
-
<title>Celerity Simple CI</title>
|
51
|
-
<style type="text/css" media="screen">
|
52
|
-
body {font: 10px/16px "Lucida Grande", Geneva, Arial, Verdana, sans-serif; background-color: #fff;color: #333;}
|
53
|
-
a{color:#2971a7;}
|
54
|
-
a:link,a:visited,a:active{text-decoration:none}
|
55
|
-
a:hover{text-decoration:underline}
|
56
|
-
table{border-collapse:collapse;border-spacing:0;margin-left:24px;}
|
57
|
-
</style>
|
58
|
-
</head>
|
59
|
-
|
60
|
-
<h1> Celerity </h1>
|
61
|
-
<h3><a href="result/">Test Results</a></h3>
|
62
|
-
<h3><a href="coverage/">Code Coverage</a></h3>
|
63
|
-
</html>
|
64
|
-
HTML
|
65
|
-
|
66
|
-
begin
|
67
|
-
@server = Mongrel::HttpServer.new('0.0.0.0', '8080')
|
68
|
-
rescue NameError
|
69
|
-
abort("Run `(jruby -S) gem install mongrel` to use this task.")
|
70
|
-
end
|
71
|
-
@server.register("/result", Mongrel::DirHandler.new(CI_ROOT))
|
72
|
-
@server.register("/coverage", Mongrel::DirHandler.new(CI_ROOT + "/coverage/coverage"))
|
73
|
-
@server.register("/", SimpleCI.new(@results))
|
74
|
-
Thread.new { @server.run.join }
|
75
|
-
puts "simple_ci started on #{@server.host}:#{@server.port}"
|
76
|
-
loop do
|
77
|
-
puts %x{svn up}
|
78
|
-
puts "*** running specs at #{Time.now}"
|
79
|
-
specs = get_specs
|
80
|
-
|
81
|
-
pp specs if $DEBUG
|
82
|
-
puts "*** running rcov at #{Time.now}"
|
83
|
-
puts %x{jruby -S rake --silent spec > #{CI_ROOT}/index2.html}
|
84
|
-
FileUtils.mv(CI_ROOT + "/index2.html", CI_ROOT + "/index.html", :verbose => true)
|
85
|
-
Dir[CI_ROOT + "/coverage/*"].each { |f| FileUtils.rm_r(f, :verbose => true) }
|
86
|
-
FileUtils.mv(CI_ROOT + "/../coverage", CI_ROOT + "/coverage", :verbose => true)
|
87
|
-
puts "\n*** sleeping #{Time.now}"
|
88
|
-
sleep(INTERVAL)
|
89
|
-
end
|
90
|
-
|
91
|
-
end
|
92
|
-
|
93
|
-
|
94
|
-
|