Permalink
Browse files

Initial commit after merging padrino subgems into single repo

  • Loading branch information...
0 parents commit 469974fd20250c184bb46bd167383f8bee36bea8 @nesquena nesquena committed Nov 18, 2009
Showing with 6,909 additions and 0 deletions.
  1. +5 −0 README.rdoc
  2. +38 −0 Rakefile
  3. +27 −0 TODO
  4. +5 −0 padrino-admin/.document
  5. +21 −0 padrino-admin/.gitignore
  6. +20 −0 padrino-admin/LICENSE
  7. +7 −0 padrino-admin/README.rdoc
  8. +58 −0 padrino-admin/Rakefile
  9. +1 −0 padrino-admin/VERSION
  10. 0 padrino-admin/lib/padrino-admin.rb
  11. +71 −0 padrino-admin/padrino-admin.gemspec
  12. +7 −0 padrino-admin/test/active_support_helpers.rb
  13. +74 −0 padrino-admin/test/helper.rb
  14. +7 −0 padrino-admin/test/test_padrino_admin.rb
  15. +5 −0 padrino-cache/.document
  16. +21 −0 padrino-cache/.gitignore
  17. +20 −0 padrino-cache/LICENSE
  18. +7 −0 padrino-cache/README.rdoc
  19. +58 −0 padrino-cache/Rakefile
  20. +1 −0 padrino-cache/VERSION
  21. 0 padrino-cache/lib/padrino-cache.rb
  22. +71 −0 padrino-cache/padrino-cache.gemspec
  23. +7 −0 padrino-cache/test/active_support_helpers.rb
  24. +74 −0 padrino-cache/test/helper.rb
  25. +7 −0 padrino-cache/test/test_padrino_cache.rb
  26. +5 −0 padrino-core/.document
  27. +21 −0 padrino-core/.gitignore
  28. +20 −0 padrino-core/LICENSE
  29. +7 −0 padrino-core/README.rdoc
  30. +59 −0 padrino-core/Rakefile
  31. +1 −0 padrino-core/VERSION
  32. +6 −0 padrino-core/bin/padrino
  33. +33 −0 padrino-core/lib/padrino-core.rb
  34. +112 −0 padrino-core/lib/padrino-core/application.rb
  35. +47 −0 padrino-core/lib/padrino-core/loader.rb
  36. +40 −0 padrino-core/lib/padrino-core/mounter.rb
  37. +31 −0 padrino-core/lib/padrino-core/reloader.rb
  38. +74 −0 padrino-core/lib/padrino-core/stat.rb
  39. +8 −0 padrino-core/lib/padrino-core/support_lite.rb
  40. +37 −0 padrino-core/lib/padrino-core/tasks.rb
  41. +21 −0 padrino-core/lib/padrino-core/tasks/console.rb
  42. +7 −0 padrino-core/lib/padrino-core/version.rb
  43. +90 −0 padrino-core/padrino-core.gemspec
  44. +7 −0 padrino-core/test/active_support_helpers.rb
  45. +10 −0 padrino-core/test/fixtures/extended_app/app.rb
  46. +10 −0 padrino-core/test/fixtures/simple_app/app.rb
  47. +74 −0 padrino-core/test/helper.rb
  48. +17 −0 padrino-core/test/test_padrino_core.rb
  49. +8 −0 padrino-core/test/test_padrino_mounting.rb
  50. +8 −0 padrino-core/test/test_padrino_tasks.rb
  51. +5 −0 padrino-gen/.document
  52. +21 −0 padrino-gen/.gitignore
  53. +20 −0 padrino-gen/LICENSE
  54. +7 −0 padrino-gen/README.rdoc
  55. +60 −0 padrino-gen/Rakefile
  56. +1 −0 padrino-gen/VERSION
  57. +5 −0 padrino-gen/bin/padrino-gen
  58. +81 −0 padrino-gen/lib/generators/actions.rb
  59. +49 −0 padrino-gen/lib/generators/components/actions.rb
  60. +16 −0 padrino-gen/lib/generators/components/mocks/mocha_gen.rb
  61. +16 −0 padrino-gen/lib/generators/components/mocks/rr_gen.rb
  62. +60 −0 padrino-gen/lib/generators/components/orms/activerecord_gen.rb
  63. +29 −0 padrino-gen/lib/generators/components/orms/couchrest_gen.rb
  64. +27 −0 padrino-gen/lib/generators/components/orms/datamapper_gen.rb
  65. +54 −0 padrino-gen/lib/generators/components/orms/mongomapper_gen.rb
  66. +28 −0 padrino-gen/lib/generators/components/orms/sequel_gen.rb
  67. +15 −0 padrino-gen/lib/generators/components/renderers/erb_gen.rb
  68. +16 −0 padrino-gen/lib/generators/components/renderers/haml_gen.rb
  69. +15 −0 padrino-gen/lib/generators/components/scripts/jquery_gen.rb
  70. +16 −0 padrino-gen/lib/generators/components/scripts/prototype_gen.rb
  71. +16 −0 padrino-gen/lib/generators/components/scripts/rightjs_gen.rb
  72. +27 −0 padrino-gen/lib/generators/components/tests/bacon_test_gen.rb
  73. +27 −0 padrino-gen/lib/generators/components/tests/riot_test_gen.rb
  74. +26 −0 padrino-gen/lib/generators/components/tests/rspec_test_gen.rb
  75. +26 −0 padrino-gen/lib/generators/components/tests/shoulda_test_gen.rb
  76. +26 −0 padrino-gen/lib/generators/components/tests/testspec_test_gen.rb
  77. +7 −0 padrino-gen/lib/generators/project/.gitignore
  78. +11 −0 padrino-gen/lib/generators/project/Gemfile
  79. 0 padrino-gen/lib/generators/project/apps/.empty_directory
  80. +6 −0 padrino-gen/lib/generators/project/config.ru
  81. +6 −0 padrino-gen/lib/generators/project/config/boot.rb
  82. 0 padrino-gen/lib/generators/project/lib/.empty_directory
  83. +5 −0 padrino-gen/lib/generators/project/test/test_config.rb.tt
  84. 0 padrino-gen/lib/generators/project/tmp/.emptydirectory
  85. +53 −0 padrino-gen/lib/generators/skeleton.rb
  86. +1 −0 padrino-gen/lib/padrino-gen.rb
  87. +104 −0 padrino-gen/padrino-gen.gemspec
  88. +7 −0 padrino-gen/test/active_support_helpers.rb
  89. +74 −0 padrino-gen/test/helper.rb
  90. +181 −0 padrino-gen/test/test_skeleton_generator.rb
  91. +5 −0 padrino-helpers/.document
  92. +21 −0 padrino-helpers/.gitignore
  93. +20 −0 padrino-helpers/LICENSE
  94. +7 −0 padrino-helpers/README.rdoc
  95. +58 −0 padrino-helpers/Rakefile
  96. +1 −0 padrino-helpers/VERSION
  97. +16 −0 padrino-helpers/lib/padrino-helpers.rb
  98. +97 −0 padrino-helpers/lib/padrino-helpers/asset_tag_helpers.rb
  99. +139 −0 padrino-helpers/lib/padrino-helpers/form_builder/abstract_form_builder.rb
  100. +37 −0 padrino-helpers/lib/padrino-helpers/form_builder/standard_form_builder.rb
  101. +194 −0 padrino-helpers/lib/padrino-helpers/form_helpers.rb
  102. +74 −0 padrino-helpers/lib/padrino-helpers/format_helpers.rb
  103. +98 −0 padrino-helpers/lib/padrino-helpers/output_helpers.rb
  104. +63 −0 padrino-helpers/lib/padrino-helpers/render_helpers.rb
  105. +42 −0 padrino-helpers/lib/padrino-helpers/tag_helpers.rb
  106. +116 −0 padrino-helpers/padrino-helpers.gemspec
  107. +7 −0 padrino-helpers/test/active_support_helpers.rb
  108. +61 −0 padrino-helpers/test/fixtures/markup_app/app.rb
  109. +14 −0 padrino-helpers/test/fixtures/markup_app/views/capture_concat.erb
  110. +13 −0 padrino-helpers/test/fixtures/markup_app/views/capture_concat.haml
  111. +11 −0 padrino-helpers/test/fixtures/markup_app/views/content_for.erb
  112. +9 −0 padrino-helpers/test/fixtures/markup_app/views/content_for.haml
  113. +11 −0 padrino-helpers/test/fixtures/markup_app/views/content_tag.erb
  114. +9 −0 padrino-helpers/test/fixtures/markup_app/views/content_tag.haml
  115. +8 −0 padrino-helpers/test/fixtures/markup_app/views/fields_for.erb
  116. +6 −0 padrino-helpers/test/fixtures/markup_app/views/fields_for.haml
  117. +56 −0 padrino-helpers/test/fixtures/markup_app/views/form_for.erb
  118. +47 −0 padrino-helpers/test/fixtures/markup_app/views/form_for.haml
  119. +57 −0 padrino-helpers/test/fixtures/markup_app/views/form_tag.erb
  120. +45 −0 padrino-helpers/test/fixtures/markup_app/views/form_tag.haml
  121. +5 −0 padrino-helpers/test/fixtures/markup_app/views/link_to.erb
  122. +4 −0 padrino-helpers/test/fixtures/markup_app/views/link_to.haml
  123. +3 −0 padrino-helpers/test/fixtures/markup_app/views/mail_to.erb
  124. +3 −0 padrino-helpers/test/fixtures/markup_app/views/mail_to.haml
  125. +53 −0 padrino-helpers/test/fixtures/render_app/app.rb
  126. +1 −0 padrino-helpers/test/fixtures/render_app/views/erb/test.erb
  127. +1 −0 padrino-helpers/test/fixtures/render_app/views/haml/test.haml
  128. +7 −0 padrino-helpers/test/fixtures/render_app/views/template/_user.haml
  129. +1 −0 padrino-helpers/test/fixtures/render_app/views/template/haml_template.haml
  130. +2 −0 padrino-helpers/test/fixtures/render_app/views/template/some_template.haml
  131. +73 −0 padrino-helpers/test/helper.rb
  132. +127 −0 padrino-helpers/test/test_asset_tag_helpers.rb
  133. +611 −0 padrino-helpers/test/test_form_builder.rb
  134. +406 −0 padrino-helpers/test/test_form_helpers.rb
  135. +96 −0 padrino-helpers/test/test_format_helpers.rb
  136. +63 −0 padrino-helpers/test/test_output_helpers.rb
  137. +78 −0 padrino-helpers/test/test_render_helpers.rb
  138. +73 −0 padrino-helpers/test/test_tag_helpers.rb
  139. +5 −0 padrino-mailer/.document
  140. +21 −0 padrino-mailer/.gitignore
  141. +20 −0 padrino-mailer/LICENSE
  142. +7 −0 padrino-mailer/README.rdoc
  143. +59 −0 padrino-mailer/Rakefile
  144. +1 −0 padrino-mailer/VERSION
  145. +11 −0 padrino-mailer/lib/padrino-mailer.rb
  146. +75 −0 padrino-mailer/lib/padrino-mailer/base.rb
  147. +94 −0 padrino-mailer/lib/padrino-mailer/delivery.rb
  148. +39 −0 padrino-mailer/lib/padrino-mailer/mail_object.rb
  149. +86 −0 padrino-mailer/padrino-mailer.gemspec
  150. +7 −0 padrino-mailer/test/active_support_helpers.rb
  151. +50 −0 padrino-mailer/test/fixtures/mailer_app/app.rb
  152. +1 −0 padrino-mailer/test/fixtures/mailer_app/views/demo_mailer/sample_mail.erb
  153. +2 −0 padrino-mailer/test/fixtures/mailer_app/views/sample_mailer/anniversary_message.erb
  154. +2 −0 padrino-mailer/test/fixtures/mailer_app/views/sample_mailer/birthday_message.erb
  155. +74 −0 padrino-mailer/test/helper.rb
  156. +25 −0 padrino-mailer/test/test_mail_object.rb
  157. +82 −0 padrino-mailer/test/test_mailer_base.rb
  158. +33 −0 padrino-mailer/test/test_padrino_mailer.rb
  159. +5 −0 padrino-routing/.document
  160. +21 −0 padrino-routing/.gitignore
  161. +20 −0 padrino-routing/LICENSE
  162. +7 −0 padrino-routing/README.rdoc
  163. +58 −0 padrino-routing/Rakefile
  164. +1 −0 padrino-routing/VERSION
  165. +48 −0 padrino-routing/lib/padrino-routing.rb
  166. +22 −0 padrino-routing/lib/padrino-routing/helpers.rb
  167. +27 −0 padrino-routing/lib/padrino-routing/named_route.rb
  168. +76 −0 padrino-routing/padrino-routing.gemspec
  169. +7 −0 padrino-routing/test/active_support_helpers.rb
  170. +47 −0 padrino-routing/test/fixtures/routing_app/app.rb
  171. +7 −0 padrino-routing/test/fixtures/routing_app/views/index.haml
  172. +74 −0 padrino-routing/test/helper.rb
  173. +94 −0 padrino-routing/test/test_padrino_routing.rb
  174. +5 −0 padrino/.document
  175. +21 −0 padrino/.gitignore
  176. +20 −0 padrino/LICENSE
  177. +7 −0 padrino/README.rdoc
  178. +86 −0 padrino/Rakefile
  179. +1 −0 padrino/VERSION
  180. +5 −0 padrino/lib/padrino.rb
  181. +81 −0 padrino/padrino.gemspec
  182. +10 −0 padrino/test/helper.rb
  183. +7 −0 padrino/test/test_padrino.rb
@@ -0,0 +1,5 @@
+==Padrino
+
+Padrino is the godfather of Sinatra.
+
+More info coming soon
@@ -0,0 +1,38 @@
+require "rake/clean"
+require "rake/gempackagetask"
+require 'fileutils'
+include FileUtils
+
+gems = [
+ "padrino-core",
+ "padrino-cache",
+ "padrino-admin",
+ "padrino-gen",
+ "padrino-helpers",
+ "padrino-mailer",
+ "padrino-routing",
+ "padrino"
+]
+
+%w(clean install gemspec build release).each do |task_name|
+ desc "Run #{task_name} for all projects"
+ task task_name do
+ gems.each do |dir|
+ Dir.chdir(dir) { sh "#{Gem.ruby} -S rake #{task_name}" }
+ end
+ end
+end
+
+desc "Bump patch version and release all padrino gems"
+task :publish do
+ gems.each do |dir|
+ Dir.chdir(dir) { sh "#{Gem.ruby} -S rake version:bump:patch release" }
+ end
+end
+
+require 'rake/testtask'
+Rake::TestTask.new(:test) do |test|
+ test.libs << 'lib' << 'test'
+ test.pattern = 'padrino-*/test/**/test_*.rb'
+ test.verbose = true
+end
@@ -0,0 +1,27 @@
+TODO
+
+* Add tests for padrino_core gem
+* Fix generators and project to import concept-app changes (base_app, etc)
+ * Figure out how we want the sinatra-gen to work now
+ $ padrino-gen project project_name
+ $ cd project_name
+ $ padrino-gen app app_name
+* Implement padrino-core padrino file for tasks (start, stop, test, console)
+* Decide what to do about initializers (where do they go single app, multiple apps)
+* Figure out where to work in the WardenPlugin
+* Finish sinatra-cache gem
+* Finish sinatra-admin gem
+* Add helpers to helpers gem:
+ * ajax helpers (http://github.com/rails/rails/blob/master/actionpack/lib/action_view/helpers/ajax_helper.rb)
+* Fix documentation (README, wiki) for each gem (overview in padrino and standalone usage in each subgem)
+* Move the mounting process (for multiple apps) to use rack-mount (http://github.com/josh/rack-mount)
+
+COMPLETED
+
+* Moved over all the gems to jeweler with built in rake tasks releases, testing, versioning, etc
+* Added gems to their own repos and added them back to test-app as submodules
+* Added over existing tests and make them pass for each gem
+* Made the sinatra-gen at least have tests pass and fixed errors (still needs a lot of work)
+* Added the padrino bin file to padrino-core using Thor to stub out support for the commands (still need to be implemented)
+* Added support for test task outside in lib/padrino which runs all tests for all the subgems
+
@@ -0,0 +1,5 @@
+README.rdoc
+lib/**/*.rb
+bin/*
+features/**/*.feature
+LICENSE
@@ -0,0 +1,21 @@
+## MAC OS
+.DS_Store
+
+## TEXTMATE
+*.tmproj
+tmtags
+
+## EMACS
+*~
+\#*
+.\#*
+
+## VIM
+*.swp
+
+## PROJECT::GENERAL
+coverage
+rdoc
+pkg
+
+## PROJECT::SPECIFIC
@@ -0,0 +1,20 @@
+Copyright (c) 2009 Padrino
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,7 @@
+= padrino-admin
+
+Description goes here.
+
+== Copyright
+
+Copyright (c) 2009 Padrino. See LICENSE for details.
@@ -0,0 +1,58 @@
+require 'rubygems'
+require 'rake'
+
+begin
+ require 'jeweler'
+ Jeweler::Tasks.new do |gem|
+ gem.name = "padrino-admin"
+ gem.summary = "Admin Dashboard for Padrino"
+ gem.description = "Admin View for Padrino applications"
+ gem.email = "nesquena@gmail.com"
+ gem.homepage = "http://github.com/padrino/padrino-admin"
+ gem.authors = ["Padrino Team", "Nathan Esquenazi", "Davide D'Agostino", "Arthur Chiu"]
+ gem.add_runtime_dependency "sinatra", ">= 0.9.2"
+ gem.add_development_dependency "haml", ">= 2.2.1"
+ gem.add_development_dependency "shoulda", ">= 0"
+ gem.add_development_dependency "mocha", ">= 0.9.7"
+ gem.add_development_dependency "rack-test", ">= 0.5.0"
+ gem.add_development_dependency "webrat", ">= 0.5.1"
+ # gem is a Gem::Specification... see http://www.rubygems.org/read/chapter/20 for additional settings
+ end
+ Jeweler::GemcutterTasks.new
+rescue LoadError
+ puts "Jeweler (or a dependency) not available. Install it with: sudo gem install jeweler"
+end
+
+require 'rake/testtask'
+Rake::TestTask.new(:test) do |test|
+ test.libs << 'lib' << 'test'
+ test.pattern = 'test/**/test_*.rb'
+ test.verbose = true
+end
+
+begin
+ require 'rcov/rcovtask'
+ Rcov::RcovTask.new do |test|
+ test.libs << 'test'
+ test.pattern = 'test/**/test_*.rb'
+ test.verbose = true
+ end
+rescue LoadError
+ task :rcov do
+ abort "RCov is not available. In order to run rcov, you must: sudo gem install spicycode-rcov"
+ end
+end
+
+task :test => :check_dependencies
+
+task :default => :test
+
+require 'rake/rdoctask'
+Rake::RDocTask.new do |rdoc|
+ version = File.exist?('VERSION') ? File.read('VERSION') : ""
+
+ rdoc.rdoc_dir = 'rdoc'
+ rdoc.title = "padrino-admin #{version}"
+ rdoc.rdoc_files.include('README*')
+ rdoc.rdoc_files.include('lib/**/*.rb')
+end
@@ -0,0 +1 @@
+0.1.1
No changes.
@@ -0,0 +1,71 @@
+# Generated by jeweler
+# DO NOT EDIT THIS FILE DIRECTLY
+# Instead, edit Jeweler::Tasks in Rakefile, and run the gemspec command
+# -*- encoding: utf-8 -*-
+
+Gem::Specification.new do |s|
+ s.name = %q{padrino-admin}
+ s.version = "0.1.1"
+
+ s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
+ s.authors = ["Padrino Team", "Nathan Esquenazi", "Davide D'Agostino", "Arthur Chiu"]
+ s.date = %q{2009-11-17}
+ s.description = %q{Admin View for Padrino applications}
+ s.email = %q{nesquena@gmail.com}
+ s.extra_rdoc_files = [
+ "LICENSE",
+ "README.rdoc"
+ ]
+ s.files = [
+ ".document",
+ ".gitignore",
+ "LICENSE",
+ "README.rdoc",
+ "Rakefile",
+ "VERSION",
+ "lib/padrino-admin.rb",
+ "padrino-admin.gemspec",
+ "test/active_support_helpers.rb",
+ "test/helper.rb",
+ "test/test_padrino_admin.rb"
+ ]
+ s.homepage = %q{http://github.com/padrino/padrino-admin}
+ s.rdoc_options = ["--charset=UTF-8"]
+ s.require_paths = ["lib"]
+ s.rubygems_version = %q{1.3.5}
+ s.summary = %q{Admin Dashboard for Padrino}
+ s.test_files = [
+ "test/active_support_helpers.rb",
+ "test/helper.rb",
+ "test/test_padrino_admin.rb"
+ ]
+
+ if s.respond_to? :specification_version then
+ current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
+ s.specification_version = 3
+
+ if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
+ s.add_runtime_dependency(%q<sinatra>, [">= 0.9.2"])
+ s.add_development_dependency(%q<haml>, [">= 2.2.1"])
+ s.add_development_dependency(%q<shoulda>, [">= 0"])
+ s.add_development_dependency(%q<mocha>, [">= 0.9.7"])
+ s.add_development_dependency(%q<rack-test>, [">= 0.5.0"])
+ s.add_development_dependency(%q<webrat>, [">= 0.5.1"])
+ else
+ s.add_dependency(%q<sinatra>, [">= 0.9.2"])
+ s.add_dependency(%q<haml>, [">= 2.2.1"])
+ s.add_dependency(%q<shoulda>, [">= 0"])
+ s.add_dependency(%q<mocha>, [">= 0.9.7"])
+ s.add_dependency(%q<rack-test>, [">= 0.5.0"])
+ s.add_dependency(%q<webrat>, [">= 0.5.1"])
+ end
+ else
+ s.add_dependency(%q<sinatra>, [">= 0.9.2"])
+ s.add_dependency(%q<haml>, [">= 2.2.1"])
+ s.add_dependency(%q<shoulda>, [">= 0"])
+ s.add_dependency(%q<mocha>, [">= 0.9.7"])
+ s.add_dependency(%q<rack-test>, [">= 0.5.0"])
+ s.add_dependency(%q<webrat>, [">= 0.5.1"])
+ end
+end
+
@@ -0,0 +1,7 @@
+unless Fixnum.method_defined?(:days)
+ require 'active_support/core_ext/object/misc'
+ require 'active_support/core_ext/date'
+ require 'active_support/core_ext/time'
+ require 'active_support/core_ext/numeric'
+ require 'active_support/duration'
+end
@@ -0,0 +1,74 @@
+require 'rubygems'
+require 'test/unit'
+require 'shoulda'
+require 'mocha'
+require 'rack/test'
+require 'webrat'
+
+$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
+$LOAD_PATH.unshift(File.dirname(__FILE__))
+require 'active_support_helpers'
+require 'padrino-helpers'
+require 'padrino-admin'
+
+class Test::Unit::TestCase
+ include Padrino::Helpers::OutputHelpers
+ include Padrino::Helpers::TagHelpers
+ include Padrino::Helpers::AssetTagHelpers
+ include Rack::Test::Methods
+ include Webrat::Methods
+ include Webrat::Matchers
+
+ Webrat.configure do |config|
+ config.mode = :rack
+ end
+
+ def stop_time_for_test
+ time = Time.now
+ Time.stubs(:now).returns(time)
+ return time
+ end
+
+ # assert_has_tag(:h1, :content => "yellow") { "<h1>yellow</h1>" }
+ # In this case, block is the html to evaluate
+ def assert_has_tag(name, attributes = {}, &block)
+ html = block && block.call
+ matcher = HaveSelector.new(name, attributes)
+ raise "Please specify a block!" if html.blank?
+ assert matcher.matches?(html), matcher.failure_message
+ end
+
+ # assert_has_no_tag, tag(:h1, :content => "yellow") { "<h1>green</h1>" }
+ # In this case, block is the html to evaluate
+ def assert_has_no_tag(name, attributes = {}, &block)
+ html = block && block.call
+ attributes.merge!(:count => 0)
+ matcher = HaveSelector.new(name, attributes)
+ raise "Please specify a block!" if html.blank?
+ assert matcher.matches?(html), matcher.failure_message
+ end
+
+ # Silences the output by redirecting to stringIO
+ # silence_logger { ...commands... } => "...output..."
+ def silence_logger(&block)
+ orig_stdout = $stdout
+ $stdout = log_buffer = StringIO.new
+ block.call
+ $stdout = orig_stdout
+ log_buffer.rewind && log_buffer.read
+ end
+
+ # Asserts that a file matches the pattern
+ def assert_match_in_file(pattern, file)
+ assert File.exist?(file), "File '#{file}' does not exist!"
+ assert_match pattern, File.read(file)
+ end
+end
+
+module Webrat
+ module Logging
+ def logger # :nodoc:
+ @logger = nil
+ end
+ end
+end
@@ -0,0 +1,7 @@
+require File.dirname(__FILE__) + '/helper'
+
+class TestPadrinoAdmin < Test::Unit::TestCase
+ should "probably rename this file and start testing for real" do
+ flunk "hey buddy, you should probably rename this file and start testing for real"
+ end
+end
@@ -0,0 +1,5 @@
+README.rdoc
+lib/**/*.rb
+bin/*
+features/**/*.feature
+LICENSE
@@ -0,0 +1,21 @@
+## MAC OS
+.DS_Store
+
+## TEXTMATE
+*.tmproj
+tmtags
+
+## EMACS
+*~
+\#*
+.\#*
+
+## VIM
+*.swp
+
+## PROJECT::GENERAL
+coverage
+rdoc
+pkg
+
+## PROJECT::SPECIFIC
Oops, something went wrong.

0 comments on commit 469974f

Please sign in to comment.