celerity 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (93) hide show
  1. data/History.txt +10 -0
  2. data/README.txt +8 -11
  3. data/Rakefile +5 -3
  4. data/benchmark/bm_2000_spans.rb +48 -0
  5. data/benchmark/bm_digg.rb +26 -0
  6. data/benchmark/bm_google_images.rb +36 -0
  7. data/benchmark/bm_input_locator.rb +69 -0
  8. data/benchmark/loader.rb +9 -0
  9. data/lib/celerity.rb +3 -1
  10. data/lib/celerity/container.rb +23 -171
  11. data/lib/celerity/disabled_element.rb +1 -1
  12. data/lib/celerity/element.rb +78 -47
  13. data/lib/celerity/element_collections.rb +16 -32
  14. data/lib/celerity/element_locator.rb +135 -0
  15. data/lib/celerity/elements/button.rb +15 -0
  16. data/lib/celerity/elements/file_field.rb +1 -1
  17. data/lib/celerity/elements/form.rb +2 -1
  18. data/lib/celerity/elements/frame.rb +18 -21
  19. data/lib/celerity/elements/image.rb +2 -8
  20. data/lib/celerity/elements/label.rb +1 -3
  21. data/lib/celerity/elements/link.rb +1 -1
  22. data/lib/celerity/elements/option.rb +16 -0
  23. data/lib/celerity/elements/radio_check.rb +18 -7
  24. data/lib/celerity/elements/select_list.rb +1 -17
  25. data/lib/celerity/elements/table.rb +4 -4
  26. data/lib/celerity/elements/table_body.rb +6 -8
  27. data/lib/celerity/elements/table_cell.rb +3 -14
  28. data/lib/celerity/elements/table_row.rb +4 -10
  29. data/lib/celerity/elements/text_field.rb +16 -4
  30. data/lib/celerity/extra/method_generator.rb +144 -0
  31. data/lib/celerity/identifier.rb +10 -0
  32. data/lib/celerity/ie.rb +28 -13
  33. data/lib/celerity/input_element.rb +0 -4
  34. data/lib/celerity/non_control_elements.rb +12 -12
  35. data/lib/celerity/version.rb +1 -1
  36. data/spec/area_spec.rb +41 -41
  37. data/spec/areas_spec.rb +11 -11
  38. data/spec/button_spec.rb +73 -68
  39. data/spec/buttons_spec.rb +10 -10
  40. data/spec/checkbox_spec.rb +102 -96
  41. data/spec/checkboxes_spec.rb +10 -10
  42. data/spec/div_spec.rb +78 -73
  43. data/spec/divs_spec.rb +10 -10
  44. data/spec/element_spec.rb +20 -11
  45. data/spec/filefield_spec.rb +36 -41
  46. data/spec/filefields_spec.rb +10 -10
  47. data/spec/form_spec.rb +29 -29
  48. data/spec/forms_spec.rb +11 -11
  49. data/spec/frame_spec.rb +54 -49
  50. data/spec/hidden_spec.rb +43 -43
  51. data/spec/hiddens_spec.rb +10 -10
  52. data/spec/html/2000_spans.html +2009 -0
  53. data/spec/html/forms_with_input_elements.html +15 -9
  54. data/spec/html/non_control_elements.html +4 -2
  55. data/spec/ie_spec.rb +82 -48
  56. data/spec/image_spec.rb +83 -100
  57. data/spec/images_spec.rb +10 -10
  58. data/spec/label_spec.rb +29 -29
  59. data/spec/labels_spec.rb +10 -10
  60. data/spec/li_spec.rb +41 -41
  61. data/spec/link_spec.rb +65 -59
  62. data/spec/links_spec.rb +11 -11
  63. data/spec/lis_spec.rb +10 -10
  64. data/spec/map_spec.rb +30 -30
  65. data/spec/maps_spec.rb +10 -10
  66. data/spec/p_spec.rb +49 -49
  67. data/spec/pre_spec.rb +41 -41
  68. data/spec/pres_spec.rb +10 -10
  69. data/spec/ps_spec.rb +10 -10
  70. data/spec/radio_spec.rb +104 -97
  71. data/spec/radios_spec.rb +11 -11
  72. data/spec/select_list_spec.rb +118 -106
  73. data/spec/select_lists_spec.rb +15 -15
  74. data/spec/span_spec.rb +54 -54
  75. data/spec/spans_spec.rb +11 -11
  76. data/spec/spec.opts +1 -1
  77. data/spec/spec_helper.rb +23 -3
  78. data/spec/table_bodies.rb +8 -8
  79. data/spec/table_bodies_spec.rb +9 -9
  80. data/spec/table_body_spec.rb +28 -27
  81. data/spec/table_cell_spec.rb +25 -25
  82. data/spec/table_cells_spec.rb +16 -16
  83. data/spec/table_row_spec.rb +16 -16
  84. data/spec/table_rows_spec.rb +12 -12
  85. data/spec/table_spec.rb +36 -36
  86. data/spec/tables_spec.rb +12 -12
  87. data/spec/text_field_spec.rb +111 -92
  88. data/spec/text_fields_spec.rb +13 -13
  89. data/tasks/benchmark.rake +3 -0
  90. data/tasks/rspec.rake +2 -2
  91. data/tasks/testserver.rake +15 -0
  92. metadata +58 -46
  93. 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
-