Browse files

Get rid of these garbage tests which don't run anymore

Fixes #51
  • Loading branch information...
1 parent b23bdd6 commit 640b1737001c9aa4266eae831a8d6fdc6e9e6cc4 @rtyler committed Aug 14, 2012
Showing with 0 additions and 250 deletions.
  1. +0 −35 test/helper.rb
  2. +0 −202 test/test_integrations.rb
  3. +0 −13 test/test_testcase.rb
View
35 test/helper.rb
@@ -1,35 +0,0 @@
-require 'rubygems'
-require 'test/unit'
-require 'net/telnet'
-require 'fileutils'
-
-$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
-$LOAD_PATH.unshift(File.dirname(__FILE__))
-require 'sauce'
-
-include Sauce::Utilities
-
-Sauce.config do |config|
- config.browsers = [
- ["Windows 2003", "firefox", "3.6."],
- ["Windows 2003", "iexplore", "8."]
- ]
- config.browser_url = "http://saucelabs.com"
-
- #config.application_host = "localhost"
- #config.application_port = "4444"
-end
-
-def ensure_rvm_installed
- rvm_executable = File.expand_path("~/.rvm/bin/rvm")
- if File.exist? rvm_executable
- unless defined?(RVM)
- rvm_lib_path = File.expand_path("~/.rvm/lib")
- $LOAD_PATH.unshift(rvm_lib_path) unless $LOAD_PATH.include?(rvm_lib_path)
- require 'rvm'
- end
- else
- raise "You do not have RVM installed. It is required for the integration tests.\n" +
- "Please install it from http://rvm.beginrescueend.com/"
- end
-end
View
202 test/test_integrations.rb
@@ -1,202 +0,0 @@
-require File.expand_path("../helper.rb", __FILE__)
-
-class TestIntegrations < Test::Unit::TestCase
- @@globally_setup = false
-
- def setup
- if !@@globally_setup
- ensure_rvm_installed
- Dir.chdir File.expand_path("../..", __FILE__) do
- silence_stream(STDOUT) do
- system("gem build sauce.gemspec")
- end
- end
- ENV['SAUCE_GEM'] = File.expand_path("../../"+Dir.entries(".").select {|f| f =~ /sauce-.*.gem/}.sort.last, __FILE__)
- @@globally_setup = true
- end
- end
-
- def run_with_ruby(ruby_version, test)
- ruby_version = RVM.list_strings.find {|version| version =~ /#{ruby_version}/}
- if ruby_version.nil?
- RVM.install ruby_version
- ruby_version = RVM.list_strings.find {|version| version =~ /#{ruby_version}/}
- end
-
- gemset_name = "saucegem_#{test.to_s}"
- rubie = RVM.environment(ruby_version)
- rubie.gemset.create gemset_name
- begin
- rubie = RVM.environment("#{ruby_version}@#{gemset_name}")
- send(test, rubie)
- ensure
- rubie.gemset.delete gemset_name
- end
- end
-
- def run_in_environment(env, command)
- result = env.run(command)
- assert result.successful?, result.stderr
- end
-
- def in_tempdir
- oldwd = Dir.pwd
- temp = File.join(Dir.tmpdir, "sauce_gem_integration_test_#{rand(100000)}")
- Dir.mkdir(temp)
- Dir.chdir(temp)
- begin
- yield temp
- ensure
- Dir.chdir(oldwd)
- FileUtils.remove_dir(temp)
- end
- end
-
- def with_rails_3_environment(env)
- in_tempdir do |temp|
- run_in_environment(env, "gem install rails --no-rdoc --no-ri")
- run_in_environment(env, "rails new rails3_testapp")
- Dir.chdir("rails3_testapp")
- run_in_environment(env, "bundle install")
- run_in_environment(env, "rake db:migrate")
- yield
- end
- end
-
- def with_rails_2_environment(env)
- in_tempdir do |temp|
- run_in_environment(env, "gem install rails -v 2.3.10 --no-rdoc --no-ri")
- run_in_environment(env, "gem install sqlite3 --no-rdoc --no-ri")
- run_in_environment(env, "rails rails2_testapp")
- Dir.chdir("rails2_testapp")
- run_in_environment(env, "rake db:migrate")
- yield
- end
- end
-
- def recipe_rails3_testunit(env)
- with_rails_3_environment(env) do
- # Add some Sauce
- open("Gemfile", 'a') do |f|
- f.puts "gem 'sauce'"
- end
- run_in_environment(env, "gem install \"$SAUCE_GEM\" --no-rdoc --no-ri")
- run_in_environment(env, "bundle install")
- run_in_environment(env, "rails generate sauce:install #{ENV['SAUCE_USERNAME']} #{ENV['SAUCE_ACCESS_KEY']}")
-
- open("test/selenium/demo_test.rb", 'wb') do |file|
- file.write(<<-EOF)
- require "test_helper"
-
- class DemoTest < Sauce::RailsTestCase
- test "my app" do
- page.open "/"
- assert page.is_text_present("Welcome aboard")
- end
- end
- EOF
- end
-
- run_in_environment(env, "rake test:selenium:sauce")
- run_in_environment(env, "rake test:selenium:local") unless ENV['SAUCE_TEST_NO_LOCAL']
- end
- end
-
- def recipe_rails3_rspec(env)
- with_rails_3_environment(env) do
- open("Gemfile", 'a') do |f|
- f.puts "gem 'sauce'"
- f.puts "gem 'rspec-rails'"
- end
- run_in_environment(env, "gem install \"$SAUCE_GEM\" --no-rdoc --no-ri")
- run_in_environment(env, "bundle install")
- run_in_environment(env, "rails generate rspec:install")
-
- # Add some Sauce
- run_in_environment(env, "rails generate sauce:install #{ENV['SAUCE_USERNAME']} #{ENV['SAUCE_ACCESS_KEY']}")
-
- open("spec/selenium/demo_spec.rb", 'wb') do |file|
- file.write(<<-EOF)
- require "spec_helper"
-
- describe "my app" do
- it "should have a home page" do
- page.open "/"
- page.is_text_present("Welcome aboard").should be_true
- end
- end
- EOF
- end
-
- run_in_environment(env, "rake spec:selenium:sauce")
- run_in_environment(env, "rake spec:selenium:local") unless ENV['SAUCE_TEST_NO_LOCAL']
- end
- end
-
- def recipe_rails2_testunit(env)
- with_rails_2_environment(env) do
- run_in_environment(env, "gem install \"$SAUCE_GEM\" --no-rdoc --no-ri")
- run_in_environment(env, "script/generate sauce #{ENV['SAUCE_USERNAME']} #{ENV['SAUCE_ACCESS_KEY']}")
-
- open("test/selenium/demo_test.rb", 'wb') do |file|
- file.write(<<-EOF)
- require "test_helper"
-
- class DemoTest < Sauce::RailsTestCase
- test "my app" do
- page.open "/"
- assert page.is_text_present("Welcome aboard")
- end
- end
- EOF
- end
-
- run_in_environment(env, "rake test:selenium:sauce")
- run_in_environment(env, "rake test:selenium:local") unless ENV['SAUCE_TEST_NO_LOCAL']
- end
- end
-
- def recipe_rails2_rspec(env)
- with_rails_2_environment(env) do
-
- run_in_environment(env, "gem install rspec-rails -v '< 2' --no-rdoc --no-ri")
- if env.environment_name =~ /^ruby-1.9.*/
- # newer versions of hoe get angry
- run_in_environment(env, "gem install hoe -v 1.5.1 --no-rdoc --no-ri")
- # this is a strange dependency...
- run_in_environment(env, "gem install test-unit -v 1.2.3 --no-rdoc --no-ri")
- end
- run_in_environment(env, "script/generate rspec")
-
- # Add some Sauce
- run_in_environment(env, "gem install \"$SAUCE_GEM\" --no-rdoc --no-ri")
- run_in_environment(env, "script/generate sauce #{ENV['SAUCE_USERNAME']} #{ENV['SAUCE_ACCESS_KEY']}")
-
- open("spec/selenium/demo_spec.rb", 'wb') do |file|
- file.write(<<-EOF)
- require "spec_helper"
-
- describe "my app" do
- it "should have a home page" do
- page.open "/"
- page.is_text_present("Welcome aboard").should be_true
- end
- end
- EOF
- end
-
- run_in_environment(env, "rake spec:selenium:sauce --trace")
- run_in_environment(env, "rake spec:selenium:local") unless ENV['SAUCE_TEST_NO_LOCAL']
- end
- end
-
- # Turn the recipes into tests
- self.instance_methods(false).select {|m| m =~ /recipe_.*/ }.each do |recipe|
- define_method(("test_ruby18_"+recipe).to_sym) do
- run_with_ruby("ruby-1.8.7", recipe.to_sym)
- end
- define_method(("test_ruby19_"+recipe).to_sym) do
- run_with_ruby("ruby-1.9.2", recipe.to_sym)
- end
- end
-end
View
13 test/test_testcase.rb
@@ -1,13 +0,0 @@
-require File.expand_path("../helper", __FILE__)
-
-class TestSauceTestCase < Sauce::TestCase
- self.selenium_flags = {:trustAllSSLCertificates => false}
- self.sauce_config = {:browser_url => "https://cacert.org"}
-
- def test_turning_off_trustAllSSLCertificates
- selenium.set_timeout("5000")
- assert_raise Selenium::Client::CommandError do
- selenium.open("https://cacert.org")
- end
- end
-end

0 comments on commit 640b173

Please sign in to comment.