jacuzzi 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/.gitignore ADDED
@@ -0,0 +1,5 @@
1
+ .DS_Store*
2
+ tmp/tests/
3
+ results/*.html
4
+ spec/capybara_spec.rb
5
+ *.gem
data/Gemfile ADDED
@@ -0,0 +1,5 @@
1
+ source 'http://rubygems.org'
2
+ gem 'rspec'
3
+ gem 'selenium-webdriver'
4
+ gem 'capybara'
5
+ gem 'trollop'
data/Gemfile.lock ADDED
@@ -0,0 +1,46 @@
1
+ GEM
2
+ remote: http://rubygems.org/
3
+ specs:
4
+ capybara (1.1.1)
5
+ mime-types (>= 1.16)
6
+ nokogiri (>= 1.3.3)
7
+ rack (>= 1.0.0)
8
+ rack-test (>= 0.5.4)
9
+ selenium-webdriver (~> 2.0)
10
+ xpath (~> 0.1.4)
11
+ childprocess (0.2.2)
12
+ ffi (~> 1.0.6)
13
+ diff-lcs (1.1.3)
14
+ ffi (1.0.9)
15
+ json_pure (1.6.1)
16
+ mime-types (1.17.2)
17
+ nokogiri (1.5.0)
18
+ rack (1.3.5)
19
+ rack-test (0.6.1)
20
+ rack (>= 1.0)
21
+ rspec (2.7.0)
22
+ rspec-core (~> 2.7.0)
23
+ rspec-expectations (~> 2.7.0)
24
+ rspec-mocks (~> 2.7.0)
25
+ rspec-core (2.7.1)
26
+ rspec-expectations (2.7.0)
27
+ diff-lcs (~> 1.1.2)
28
+ rspec-mocks (2.7.0)
29
+ rubyzip (0.9.4)
30
+ selenium-webdriver (2.10.0)
31
+ childprocess (>= 0.2.1)
32
+ ffi (= 1.0.9)
33
+ json_pure
34
+ rubyzip
35
+ trollop (1.16.2)
36
+ xpath (0.1.4)
37
+ nokogiri (~> 1.3)
38
+
39
+ PLATFORMS
40
+ ruby
41
+
42
+ DEPENDENCIES
43
+ capybara
44
+ rspec
45
+ selenium-webdriver
46
+ trollop
data/README.markdown ADDED
@@ -0,0 +1,44 @@
1
+ jacuzzi
2
+ =======
3
+
4
+ ### About
5
+
6
+ jacuzzi is superficial wrapper over RSpec + Capybara + Selenium test setup and execution. Think of it as "poor man's" continuous integration, uh, framework. Basically, it downloads RSpec specs from a git repo and runs them in Firefox.
7
+
8
+ jacuzzi assumes Ruby 1.9.2.
9
+
10
+
11
+ ### Install
12
+
13
+ ```
14
+ $ sudo gem install jacuzzi
15
+ ```
16
+
17
+
18
+ ### Setup & Usage
19
+
20
+ 1. Make a website
21
+ 2. Write RSpec specs to test your website
22
+ 3. Put your RSpec specs in a git repo
23
+ 4. Run `jacuzzi` like this:
24
+
25
+ ```
26
+ $ jacuzzi --app-host YOUR_WEBSITE --test-source YOUR_GIT_REPO
27
+ ```
28
+
29
+ ### License
30
+
31
+ Cordelia uses the MIT license.
32
+
33
+
34
+ ### Author
35
+
36
+ Matthew Trost
37
+
38
+
39
+ ### To do
40
+
41
+ * Add option for HTML report output
42
+ * Allow user to specify the browser to use
43
+ * Take a screenshot on test failure
44
+ * Send test failure reports to Lighthouse
data/Rakefile ADDED
File without changes
data/bin/jacuzzi ADDED
@@ -0,0 +1,29 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require 'rubygems'
4
+ require 'bundler/setup'
5
+
6
+ require 'trollop'
7
+ opts = Trollop::options do
8
+ version "jacuzzi 0.0.1 (c) 2011 Matthew Trost"
9
+ banner <<-EOS
10
+ jacuzzi pulls your RSpec+Capybara+Selenium tests down from a git repo, and runs them.
11
+
12
+ Usage:
13
+ jacuzzi [options]
14
+ where [options] are:
15
+ EOS
16
+
17
+ opt :test_source, 'Your test files git repository', :type => :string
18
+ opt :app_host, 'URL of your web app under test', :type => :string
19
+ end
20
+
21
+ load 'lib/jacuzzi.rb'
22
+
23
+ jacuzzi = Jacuzzi.new
24
+ jacuzzi.test_source = opts[:test_source]
25
+ jacuzzi.app_host = opts[:app_host]
26
+
27
+ jacuzzi.heat()
28
+ puts jacuzzi.whirl()
29
+ jacuzzi.cool()
data/lib/jacuzzi.rb ADDED
@@ -0,0 +1,52 @@
1
+ require 'rubygems'
2
+ require 'bundler/setup'
3
+ require 'find'
4
+
5
+ class Jacuzzi
6
+ attr_accessor :test_source, :app_host, :test_paths
7
+
8
+ def initialize
9
+ puts "Welcome to the jacuzzi -- who knows what bugs you'll catch?"
10
+ @test_paths = []
11
+ end
12
+
13
+ def heat
14
+ %x[git clone #{@test_source} ./tmp/tests/]
15
+
16
+ Find.find('./tmp/tests/') do |path|
17
+ @test_paths << path if File.extname(path) == '.rb'
18
+ end
19
+
20
+ @test_paths.each do |path|
21
+ %x[cp #{path} ./spec/#{File.basename(path)}]
22
+ end
23
+
24
+ capybara_spec_content = <<HEREDOC
25
+ require 'rspec'
26
+ require 'capybara'
27
+ require 'capybara/dsl'
28
+ require 'spec_helper.rb'
29
+
30
+ Capybara.default_driver = :selenium
31
+ Capybara.app_host = "#{@app_host}"
32
+ HEREDOC
33
+
34
+ File.open('./spec/capybara_spec.rb', 'w') {|file|
35
+ file.write(capybara_spec_content)
36
+ }
37
+ end
38
+
39
+ def whirl
40
+ %x[rspec ./spec -c -f documentation]
41
+ end
42
+
43
+ def cool
44
+ %x[rm -rf ./tmp/tests]
45
+ %x[rm -rf ./spec/capybara_spec.rb]
46
+
47
+ @test_paths.each do |path|
48
+ %x[rm ./spec/#{File.basename(path)}]
49
+ end
50
+ end
51
+
52
+ end
File without changes
@@ -0,0 +1,3 @@
1
+ RSpec.configure do |config|
2
+ config.include Capybara::DSL
3
+ end
data/test/.gitignore ADDED
File without changes
data/tmp/.gitignore ADDED
File without changes
metadata ADDED
@@ -0,0 +1,57 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: jacuzzi
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ prerelease:
6
+ platform: ruby
7
+ authors:
8
+ - Matthew Trost
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+ date: 2011-11-10 00:00:00.000000000Z
13
+ dependencies: []
14
+ description: jacuzzi pulls your RSpec+Capybara+Selenium tests down from a git repo,
15
+ and runs them.
16
+ email: mrtrost@gmail.com
17
+ executables:
18
+ - jacuzzi
19
+ extensions: []
20
+ extra_rdoc_files: []
21
+ files:
22
+ - bin/jacuzzi
23
+ - lib/jacuzzi.rb
24
+ - results/.gitignore
25
+ - spec/spec_helper.rb
26
+ - test/.gitignore
27
+ - tmp/.gitignore
28
+ - .gitignore
29
+ - Gemfile
30
+ - Gemfile.lock
31
+ - Rakefile
32
+ - README.markdown
33
+ homepage: https://github.com/matthewtoast/jacuzzi
34
+ licenses: []
35
+ post_install_message:
36
+ rdoc_options: []
37
+ require_paths:
38
+ - lib
39
+ required_ruby_version: !ruby/object:Gem::Requirement
40
+ none: false
41
+ requirements:
42
+ - - ! '>='
43
+ - !ruby/object:Gem::Version
44
+ version: '0'
45
+ required_rubygems_version: !ruby/object:Gem::Requirement
46
+ none: false
47
+ requirements:
48
+ - - ! '>='
49
+ - !ruby/object:Gem::Version
50
+ version: '0'
51
+ requirements: []
52
+ rubyforge_project:
53
+ rubygems_version: 1.8.8
54
+ signing_key:
55
+ specification_version: 3
56
+ summary: Superficial wrapper over RSpec/Capybara/Selenium setup and execution
57
+ test_files: []