From b4dd15025018421956da7f1f94a284baec950e9a Mon Sep 17 00:00:00 2001 From: Bryan Helmkamp Date: Mon, 29 Dec 2008 00:18:50 -0500 Subject: [PATCH] Moving spec/webrat to spec/private and spec/api to spec/public (a la Merb) --- Rakefile | 14 +++++++++----- .../{webrat => private}/core/configuration_spec.rb | 0 spec/{webrat => private}/core/field_spec.rb | 0 spec/{webrat => private}/core/link_spec.rb | 0 spec/{webrat => private}/core/logging_spec.rb | 0 spec/{webrat => private}/core/session_spec.rb | 0 .../mechanize/mechanize_session_spec.rb | 0 .../merb/indifferent_access_spec.rb | 0 spec/{webrat => private}/merb/merb_session_spec.rb | 0 spec/{webrat => private}/nokogiri_spec.rb | 0 .../rails/attaches_file_spec.rb | 0 .../rails/rails_session_spec.rb | 0 spec/{webrat => private}/sinatra/helper.rb | 0 spec/{webrat => private}/sinatra/sinatra_spec.rb | 0 spec/{api => public}/basic_auth_spec.rb | 0 spec/{api => public}/check_spec.rb | 0 spec/{api => public}/choose_spec.rb | 0 spec/{api => public}/click_area_spec.rb | 0 spec/{api => public}/click_button_spec.rb | 0 spec/{api => public}/click_link_spec.rb | 0 spec/{api => public}/fill_in_spec.rb | 0 .../locators/field_by_xpath_spec.rb | 0 .../{api => public}/locators/field_labeled_spec.rb | 0 .../{api => public}/locators/field_with_id_spec.rb | 0 spec/{api => public}/matchers_spec.rb | 0 spec/{api => public}/reload_spec.rb | 0 spec/{api => public}/save_and_open_spec.rb | 0 spec/{api => public}/select_date_spec.rb | 0 spec/{api => public}/select_datetime_spec.rb | 0 spec/{api => public}/select_spec.rb | 0 spec/{api => public}/select_time_spec.rb | 0 spec/{api => public}/set_hidden_field_spec.rb | 0 spec/{api => public}/submit_form_spec.rb | 0 spec/{api => public}/visit_spec.rb | 0 spec/{api => public}/within_spec.rb | 0 35 files changed, 9 insertions(+), 5 deletions(-) rename spec/{webrat => private}/core/configuration_spec.rb (100%) rename spec/{webrat => private}/core/field_spec.rb (100%) rename spec/{webrat => private}/core/link_spec.rb (100%) rename spec/{webrat => private}/core/logging_spec.rb (100%) rename spec/{webrat => private}/core/session_spec.rb (100%) rename spec/{webrat => private}/mechanize/mechanize_session_spec.rb (100%) rename spec/{webrat => private}/merb/indifferent_access_spec.rb (100%) rename spec/{webrat => private}/merb/merb_session_spec.rb (100%) rename spec/{webrat => private}/nokogiri_spec.rb (100%) rename spec/{webrat => private}/rails/attaches_file_spec.rb (100%) rename spec/{webrat => private}/rails/rails_session_spec.rb (100%) rename spec/{webrat => private}/sinatra/helper.rb (100%) rename spec/{webrat => private}/sinatra/sinatra_spec.rb (100%) rename spec/{api => public}/basic_auth_spec.rb (100%) rename spec/{api => public}/check_spec.rb (100%) rename spec/{api => public}/choose_spec.rb (100%) rename spec/{api => public}/click_area_spec.rb (100%) rename spec/{api => public}/click_button_spec.rb (100%) rename spec/{api => public}/click_link_spec.rb (100%) rename spec/{api => public}/fill_in_spec.rb (100%) rename spec/{api => public}/locators/field_by_xpath_spec.rb (100%) rename spec/{api => public}/locators/field_labeled_spec.rb (100%) rename spec/{api => public}/locators/field_with_id_spec.rb (100%) rename spec/{api => public}/matchers_spec.rb (100%) rename spec/{api => public}/reload_spec.rb (100%) rename spec/{api => public}/save_and_open_spec.rb (100%) rename spec/{api => public}/select_date_spec.rb (100%) rename spec/{api => public}/select_datetime_spec.rb (100%) rename spec/{api => public}/select_spec.rb (100%) rename spec/{api => public}/select_time_spec.rb (100%) rename spec/{api => public}/set_hidden_field_spec.rb (100%) rename spec/{api => public}/submit_form_spec.rb (100%) rename spec/{api => public}/visit_spec.rb (100%) rename spec/{api => public}/within_spec.rb (100%) diff --git a/Rakefile b/Rakefile index 44bd364..867aee7 100644 --- a/Rakefile +++ b/Rakefile @@ -1,4 +1,4 @@ -require 'rubygems' +# require 'rubygems' require "rake/gempackagetask" require 'rake/rdoctask' require "rake/clean" @@ -52,13 +52,13 @@ end desc "Run API and Core specs" Spec::Rake::SpecTask.new do |t| t.spec_opts = ['--options', "\"#{File.dirname(__FILE__)}/spec/spec.opts\""] - t.spec_files = FileList['spec/**/*_spec.rb'] + t.spec_files = FileList['spec/public/*_spec.rb'] + FileList['spec/private/*_spec.rb'] end desc "Run all specs in spec directory with RCov" Spec::Rake::SpecTask.new(:rcov) do |t| t.spec_opts = ['--options', "\"#{File.dirname(__FILE__)}/spec/spec.opts\""] - t.spec_files = FileList['spec/**/*_spec.rb'] + t.spec_files = FileList['spec/public/*_spec.rb'] + FileList['spec/private/*_spec.rb'] t.rcov = true t.rcov_opts = lambda do IO.readlines(File.dirname(__FILE__) + "/spec/rcov.opts").map {|l| l.chomp.split " "}.flatten @@ -71,8 +71,8 @@ end desc 'Install the package as a gem.' task :install_gem => [:clean, :package] do - gem = Dir['pkg/*.gem'].first - sh "sudo gem install --local #{gem}" + gem_filename = Dir['pkg/*.gem'].first + sh "sudo gem install --local #{gem_filename}" end desc "Delete generated RDoc" @@ -99,6 +99,10 @@ task :spec_deps do end end +task :prepare do + system "ln -s ../../../../.. ./spec/integration/rails/vendor/plugins/webrat" +end + task :default => :spec task :precommit => ["spec", "spec:jruby"] \ No newline at end of file diff --git a/spec/webrat/core/configuration_spec.rb b/spec/private/core/configuration_spec.rb similarity index 100% rename from spec/webrat/core/configuration_spec.rb rename to spec/private/core/configuration_spec.rb diff --git a/spec/webrat/core/field_spec.rb b/spec/private/core/field_spec.rb similarity index 100% rename from spec/webrat/core/field_spec.rb rename to spec/private/core/field_spec.rb diff --git a/spec/webrat/core/link_spec.rb b/spec/private/core/link_spec.rb similarity index 100% rename from spec/webrat/core/link_spec.rb rename to spec/private/core/link_spec.rb diff --git a/spec/webrat/core/logging_spec.rb b/spec/private/core/logging_spec.rb similarity index 100% rename from spec/webrat/core/logging_spec.rb rename to spec/private/core/logging_spec.rb diff --git a/spec/webrat/core/session_spec.rb b/spec/private/core/session_spec.rb similarity index 100% rename from spec/webrat/core/session_spec.rb rename to spec/private/core/session_spec.rb diff --git a/spec/webrat/mechanize/mechanize_session_spec.rb b/spec/private/mechanize/mechanize_session_spec.rb similarity index 100% rename from spec/webrat/mechanize/mechanize_session_spec.rb rename to spec/private/mechanize/mechanize_session_spec.rb diff --git a/spec/webrat/merb/indifferent_access_spec.rb b/spec/private/merb/indifferent_access_spec.rb similarity index 100% rename from spec/webrat/merb/indifferent_access_spec.rb rename to spec/private/merb/indifferent_access_spec.rb diff --git a/spec/webrat/merb/merb_session_spec.rb b/spec/private/merb/merb_session_spec.rb similarity index 100% rename from spec/webrat/merb/merb_session_spec.rb rename to spec/private/merb/merb_session_spec.rb diff --git a/spec/webrat/nokogiri_spec.rb b/spec/private/nokogiri_spec.rb similarity index 100% rename from spec/webrat/nokogiri_spec.rb rename to spec/private/nokogiri_spec.rb diff --git a/spec/webrat/rails/attaches_file_spec.rb b/spec/private/rails/attaches_file_spec.rb similarity index 100% rename from spec/webrat/rails/attaches_file_spec.rb rename to spec/private/rails/attaches_file_spec.rb diff --git a/spec/webrat/rails/rails_session_spec.rb b/spec/private/rails/rails_session_spec.rb similarity index 100% rename from spec/webrat/rails/rails_session_spec.rb rename to spec/private/rails/rails_session_spec.rb diff --git a/spec/webrat/sinatra/helper.rb b/spec/private/sinatra/helper.rb similarity index 100% rename from spec/webrat/sinatra/helper.rb rename to spec/private/sinatra/helper.rb diff --git a/spec/webrat/sinatra/sinatra_spec.rb b/spec/private/sinatra/sinatra_spec.rb similarity index 100% rename from spec/webrat/sinatra/sinatra_spec.rb rename to spec/private/sinatra/sinatra_spec.rb diff --git a/spec/api/basic_auth_spec.rb b/spec/public/basic_auth_spec.rb similarity index 100% rename from spec/api/basic_auth_spec.rb rename to spec/public/basic_auth_spec.rb diff --git a/spec/api/check_spec.rb b/spec/public/check_spec.rb similarity index 100% rename from spec/api/check_spec.rb rename to spec/public/check_spec.rb diff --git a/spec/api/choose_spec.rb b/spec/public/choose_spec.rb similarity index 100% rename from spec/api/choose_spec.rb rename to spec/public/choose_spec.rb diff --git a/spec/api/click_area_spec.rb b/spec/public/click_area_spec.rb similarity index 100% rename from spec/api/click_area_spec.rb rename to spec/public/click_area_spec.rb diff --git a/spec/api/click_button_spec.rb b/spec/public/click_button_spec.rb similarity index 100% rename from spec/api/click_button_spec.rb rename to spec/public/click_button_spec.rb diff --git a/spec/api/click_link_spec.rb b/spec/public/click_link_spec.rb similarity index 100% rename from spec/api/click_link_spec.rb rename to spec/public/click_link_spec.rb diff --git a/spec/api/fill_in_spec.rb b/spec/public/fill_in_spec.rb similarity index 100% rename from spec/api/fill_in_spec.rb rename to spec/public/fill_in_spec.rb diff --git a/spec/api/locators/field_by_xpath_spec.rb b/spec/public/locators/field_by_xpath_spec.rb similarity index 100% rename from spec/api/locators/field_by_xpath_spec.rb rename to spec/public/locators/field_by_xpath_spec.rb diff --git a/spec/api/locators/field_labeled_spec.rb b/spec/public/locators/field_labeled_spec.rb similarity index 100% rename from spec/api/locators/field_labeled_spec.rb rename to spec/public/locators/field_labeled_spec.rb diff --git a/spec/api/locators/field_with_id_spec.rb b/spec/public/locators/field_with_id_spec.rb similarity index 100% rename from spec/api/locators/field_with_id_spec.rb rename to spec/public/locators/field_with_id_spec.rb diff --git a/spec/api/matchers_spec.rb b/spec/public/matchers_spec.rb similarity index 100% rename from spec/api/matchers_spec.rb rename to spec/public/matchers_spec.rb diff --git a/spec/api/reload_spec.rb b/spec/public/reload_spec.rb similarity index 100% rename from spec/api/reload_spec.rb rename to spec/public/reload_spec.rb diff --git a/spec/api/save_and_open_spec.rb b/spec/public/save_and_open_spec.rb similarity index 100% rename from spec/api/save_and_open_spec.rb rename to spec/public/save_and_open_spec.rb diff --git a/spec/api/select_date_spec.rb b/spec/public/select_date_spec.rb similarity index 100% rename from spec/api/select_date_spec.rb rename to spec/public/select_date_spec.rb diff --git a/spec/api/select_datetime_spec.rb b/spec/public/select_datetime_spec.rb similarity index 100% rename from spec/api/select_datetime_spec.rb rename to spec/public/select_datetime_spec.rb diff --git a/spec/api/select_spec.rb b/spec/public/select_spec.rb similarity index 100% rename from spec/api/select_spec.rb rename to spec/public/select_spec.rb diff --git a/spec/api/select_time_spec.rb b/spec/public/select_time_spec.rb similarity index 100% rename from spec/api/select_time_spec.rb rename to spec/public/select_time_spec.rb diff --git a/spec/api/set_hidden_field_spec.rb b/spec/public/set_hidden_field_spec.rb similarity index 100% rename from spec/api/set_hidden_field_spec.rb rename to spec/public/set_hidden_field_spec.rb diff --git a/spec/api/submit_form_spec.rb b/spec/public/submit_form_spec.rb similarity index 100% rename from spec/api/submit_form_spec.rb rename to spec/public/submit_form_spec.rb diff --git a/spec/api/visit_spec.rb b/spec/public/visit_spec.rb similarity index 100% rename from spec/api/visit_spec.rb rename to spec/public/visit_spec.rb diff --git a/spec/api/within_spec.rb b/spec/public/within_spec.rb similarity index 100% rename from spec/api/within_spec.rb rename to spec/public/within_spec.rb