roadkill 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.
- checksums.yaml +7 -0
- data/.gitignore +19 -0
- data/Gemfile +4 -0
- data/LICENSE.txt +22 -0
- data/README.md +88 -0
- data/Rakefile +1 -0
- data/bin/roadkill +144 -0
- data/files/generate/.rspec +1 -0
- data/files/generate/ready/.gitignore +1 -0
- data/files/generate/ready/database.yml.sample +8 -0
- data/files/generate/ready/db_connect.rb +55 -0
- data/files/generate/ready/integration/sample_spec.rb +8 -0
- data/files/generate/ready/spec +2 -0
- data/files/generate/templates/Gemfile.tt +11 -0
- data/files/generate/templates/database.yml.tt +8 -0
- data/files/generate/templates/spec_helper.rb.tt +15 -0
- data/files/sample_app/config.ru +2 -0
- data/files/sample_app/home.html +30 -0
- data/files/sample_app/tests/.rspec +1 -0
- data/files/sample_app/tests/integration/homepage_spec.rb +15 -0
- data/files/sample_app/todo_app.rb +6 -0
- data/integration/welcome_spec.rb +18 -0
- data/lib/roadkill.rb +5 -0
- data/lib/roadkill/version.rb +3 -0
- data/models.rb +0 -0
- data/roadkill.gemspec +28 -0
- data/setup/install_phantomjs_64bit.sh +15 -0
- data/spec +2 -0
- data/spec_helper.rb +21 -0
- data/todos.txt +13 -0
- metadata +174 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 85e0c6c220f25d47678c6c18427bdfcfce037331
|
4
|
+
data.tar.gz: 485f6ba15b7ab7bba4f8f53e51e821aa16340311
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 2e2e10e07f783241667061c44adae22a066c507f8667d006c6b40d0348dafb7c12973fc92a0d884c96da63ae97afc1259fc464ea212f7a5aedf86ebe6d17db3d
|
7
|
+
data.tar.gz: 90cf71985fedfd2f5736f189a4de8de86561e9b570eb2308f1cb0fad35aa44737c934f91bccfc2a8f36ce943b05b487bf4d2f35b34ac7c2aa4e0d95a7d480e4a
|
data/.gitignore
ADDED
data/Gemfile
ADDED
data/LICENSE.txt
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
Copyright (c) 2013 Agape Red
|
2
|
+
|
3
|
+
MIT License
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
6
|
+
a copy of this software and associated documentation files (the
|
7
|
+
"Software"), to deal in the Software without restriction, including
|
8
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
9
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
10
|
+
permit persons to whom the Software is furnished to do so, subject to
|
11
|
+
the following conditions:
|
12
|
+
|
13
|
+
The above copyright notice and this permission notice shall be
|
14
|
+
included in all copies or substantial portions of the Software.
|
15
|
+
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
17
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
18
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
19
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
20
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
21
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
22
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,88 @@
|
|
1
|
+
# Roadkill
|
2
|
+
|
3
|
+
##TL;DR:
|
4
|
+
This gem lets you easily install [Capybara](https://github.com/jnicklas/capybara) with [PhantomJS](https://github.com/ariya/phantomjs) and easily use them from *any* web application project directory so that you can start writing tests for your web application's pages right away.
|
5
|
+
|
6
|
+
If you're new to acceptance testing, it even includes sample tests and a tiny app to get you started playing with it!
|
7
|
+
|
8
|
+
##Description:
|
9
|
+
|
10
|
+
Testing the web pages that your application displays to your users is important, no matter how the technology you work with creates and serves them. Whether its a dynamic database-driven application or a blog being statically generated from time to time, any site can benefit from tests that will spot problems before your visitors see them.
|
11
|
+
|
12
|
+
When it comes to writing acceptance tests, Rails developers have excellent gems that make using tools like Capybara or Cucumber easy when keeping the page-level behavior of their features well covered and up-to-date. But what about PHP, Python, JavaScript, or Java devs? Heck, what about plain old static HTML?
|
13
|
+
|
14
|
+
The purpose of this gem is to bring a similar level of ease in adding acceptance tests to *any* web development project, regardless of the stack being used. The gem painlessly brings together [Capybara](https://github.com/jnicklas/capybara) for headless Webkit testing with [PhantomJS](https://github.com/ariya/phantomjs) for JavaScript support through the [Poltergeist](https://github.com/jonleighton/poltergeist) driver. It includes a tiny example web app for trying out the tools with a couple of sample test specs.
|
15
|
+
|
16
|
+
After installing the gem and pointing the spec_helper file to the address and/or port number of your web application, you'll easily be able to start adding your own test specs that can navigate your site, detect content on a page, click on links, and interact with your UI elements. Sleep better at night, knowing that your site is wrapped up in a warm security blanket of automated scrutiny.
|
17
|
+
|
18
|
+
##Installation:
|
19
|
+
```gem install roadkill```
|
20
|
+
|
21
|
+
Roadkill uses the headless browser [phantomjs](http://phantomjs.org/) to run your tests. If you need to install [phantomjs](http://phantomjs.org/), you can do so directly with roadkill:
|
22
|
+
|
23
|
+
```roadkill install_phantomjs```
|
24
|
+
|
25
|
+
The installer will ask whether you want to use the 32 or 64 bit version of phantomjs.
|
26
|
+
|
27
|
+
##Sample Application:
|
28
|
+
Roadkill contains a sample rack application to show you how to use an acceptance test suite with a live application. Although we used rack for the application, please keep in mind that the app could be written in anything - node, PHP, or even ...(*cringe* java).
|
29
|
+
|
30
|
+
To see the sample app, run:
|
31
|
+
|
32
|
+
```roadkill sample_app```
|
33
|
+
|
34
|
+
This will create a directory called *sample_app*. To run the acceptance tests for this app, you will first need to bundle install the gems:
|
35
|
+
|
36
|
+
```cd sample_app/tests && bundle install && cd ..```
|
37
|
+
|
38
|
+
The gems necessary to test your site are now installed. Let's start the rack application.
|
39
|
+
|
40
|
+
```rackup config.ru```
|
41
|
+
|
42
|
+
Awesome! We now have a simple application running. You should be able to visit http://localhost:9292 , and see a simple application.
|
43
|
+
|
44
|
+
We have some basic acceptance tests already written for the app. Let's run these tests.
|
45
|
+
|
46
|
+
```cd tests```
|
47
|
+
|
48
|
+
```rspec spec```
|
49
|
+
|
50
|
+
Yay! Passing tests! Roadkill is actually *interacting* with the app through the phantomjs browser.
|
51
|
+
|
52
|
+
##Usage:
|
53
|
+
Once you're ready to create tests for your own project, it's as simple as running a generator within the project directory of your choice. Enter your project directory:
|
54
|
+
|
55
|
+
```cd your_project```
|
56
|
+
|
57
|
+
Let's ask roadkill to generate the *tests* directory, where everything will be contained. The command will ask you for some information about your site in order to start testing properly.
|
58
|
+
|
59
|
+
```roadkill generate```
|
60
|
+
|
61
|
+
Excellent. We now have a place to store acceptance tests. Let's get all the gems installed:
|
62
|
+
|
63
|
+
```bundle install```
|
64
|
+
|
65
|
+
Go ahead and create some [capybara](https://github.com/jnicklas/capybara) tests in the *acceptance* directory. Anything in the "acceptance" directory that ends with "_spec.rb" will be run. You can now run the tests against your site:
|
66
|
+
|
67
|
+
```rspec spec```
|
68
|
+
|
69
|
+
You now have a method for running simple, powerful tests against your site.
|
70
|
+
|
71
|
+
|
72
|
+
|
73
|
+
|
74
|
+
|
75
|
+
|
76
|
+
|
77
|
+
|
78
|
+
|
79
|
+
|
80
|
+
|
81
|
+
|
82
|
+
## Contributing
|
83
|
+
|
84
|
+
1. Fork it
|
85
|
+
2. Create your feature branch (`git checkout -b my-new-feature`)
|
86
|
+
3. Commit your changes (`git commit -am 'Add some feature'`)
|
87
|
+
4. Push to the branch (`git push origin my-new-feature`)
|
88
|
+
5. Create new Pull Request
|
data/Rakefile
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
require "bundler/gem_tasks"
|
data/bin/roadkill
ADDED
@@ -0,0 +1,144 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
require "rubygems" # ruby1.9 doesn't "require" it though
|
3
|
+
require "thor"
|
4
|
+
|
5
|
+
class Roadkill < Thor
|
6
|
+
include Thor::Actions
|
7
|
+
def self.source_root
|
8
|
+
File.dirname(__FILE__)
|
9
|
+
end
|
10
|
+
|
11
|
+
TEST_DIR = "tests"
|
12
|
+
SAMPLE_APP_DIR = "sample_app"
|
13
|
+
|
14
|
+
DEFAULT_ENVIRONMENT_URL = "http://localhost:80"
|
15
|
+
DEFAULT_DATABASE_ENCODING = "utf-8"
|
16
|
+
# Generate files, dirs, and sample files
|
17
|
+
desc "generate", "Generate the files to start testing your application."
|
18
|
+
def generate
|
19
|
+
config = {
|
20
|
+
database: {},
|
21
|
+
environment:{}
|
22
|
+
}
|
23
|
+
if yes?("Would you like to setup your tests to connect to your development database?")
|
24
|
+
config[:database][:hostname] = ask "What is your database host?"
|
25
|
+
config[:database][:adapter] = get_adapter_from ask("What is your database adapter? (MySQL, PostgreSQL, and SQLite3 are best supported)").downcase
|
26
|
+
config[:database][:database] = ask "What is your database name?"
|
27
|
+
config[:database][:username] = ask "What is your database username?"
|
28
|
+
config[:database][:password] = ask "What is your database password?"
|
29
|
+
|
30
|
+
encoding = ask "What is your database encoding? (default is #{DEFAULT_DATABASE_ENCODING})"
|
31
|
+
encoding = DEFAULT_DATABASE_ENCODING if encoding == ""
|
32
|
+
config[:database][:encoding] = encoding
|
33
|
+
end
|
34
|
+
|
35
|
+
uri_port = ask "What is your development URI:Port (default is #{DEFAULT_ENVIRONMENT_URL})?"
|
36
|
+
uri_port = DEFAULT_ENVIRONMENT_URL if uri_port == ""
|
37
|
+
unless uri_port.match /^http/
|
38
|
+
uri_port = "http://#{uri_port}"
|
39
|
+
end
|
40
|
+
|
41
|
+
config[:environment][:uri_port] = uri_port
|
42
|
+
|
43
|
+
generate_from config
|
44
|
+
end
|
45
|
+
|
46
|
+
# Generate a sample rack app
|
47
|
+
desc "sample_app", "Generate a sample rack app."
|
48
|
+
def sample_app
|
49
|
+
empty_directory self.class::SAMPLE_APP_DIR
|
50
|
+
sample_app_config = {
|
51
|
+
database:{}, # No database on the sample app
|
52
|
+
environment: {
|
53
|
+
uri_port: "http://localhost:9292"
|
54
|
+
}
|
55
|
+
}
|
56
|
+
|
57
|
+
directory "../files/sample_app", "#{self.class::SAMPLE_APP_DIR}"
|
58
|
+
generate_from sample_app_config, self.class::SAMPLE_APP_DIR + "/tests"
|
59
|
+
|
60
|
+
say "Your sample app has been generated!"
|
61
|
+
say "To get things working, you'll first need to bundle install in the tests dir:"
|
62
|
+
say " pushd sample_app/tests"
|
63
|
+
say " bundle install"
|
64
|
+
say " popd"
|
65
|
+
say "Alternatively, here is a one-liner that will do the same thing:"
|
66
|
+
say " cd sample_app/tests && bundle install ; cd ../.."
|
67
|
+
say ""
|
68
|
+
say "Once this is complete, you may run the rack application with:"
|
69
|
+
say " cd sample_app"
|
70
|
+
say " rackup config.ru -D"
|
71
|
+
say ""
|
72
|
+
say "You can then run the tests with:"
|
73
|
+
say " cd tests"
|
74
|
+
say " rspec spec"
|
75
|
+
end
|
76
|
+
|
77
|
+
# Install phantomjs
|
78
|
+
desc "install_phantomjs", "Install PhantomJS - provide 32bit or 64bit to identify which version to install."
|
79
|
+
def install_phantomjs
|
80
|
+
version = ask("What version of phantomjs would you like to install?", limited_to: ["32","64"])
|
81
|
+
sudo = yes?("Can we run the commands as sudo?") ? "sudo" : ""
|
82
|
+
|
83
|
+
file = (version == "32") ?
|
84
|
+
"phantomjs-1.9.1-linux-i686":
|
85
|
+
"phantomjs-1.9.1-linux-x86_64"
|
86
|
+
|
87
|
+
say "Installing phantom js #{version} bit"
|
88
|
+
say "First, we're going to make sure you have some dependencies."
|
89
|
+
run("#{sudo} apt-get install fontconfig bzip2 tar")
|
90
|
+
run("wget https://phantomjs.googlecode.com/files/#{file}.tar.bz2")
|
91
|
+
run("bunzip2 #{file}.tar.bz2")
|
92
|
+
run("tar -xf #{file}.tar")
|
93
|
+
run("#{sudo} mv #{file}/bin/phantomjs /usr/local/bin/")
|
94
|
+
run("rm #{file}.tar #{file}/ -rf")
|
95
|
+
|
96
|
+
say "Phantom JS #{version} bit installed."
|
97
|
+
end
|
98
|
+
|
99
|
+
private
|
100
|
+
def get_adapter_from(database)
|
101
|
+
adapter = database
|
102
|
+
adapter = "mysql2" if adapter == "mysql"
|
103
|
+
adapter
|
104
|
+
end
|
105
|
+
|
106
|
+
# Return the correct database gem for the given adapter
|
107
|
+
def get_adapter_gem_from(adapter)
|
108
|
+
gem = adapter
|
109
|
+
gem = "pg" if adapter == "postgresql"
|
110
|
+
gem
|
111
|
+
end
|
112
|
+
|
113
|
+
def generate_from(config, tests_dir = nil)
|
114
|
+
tests_dir ||= self.class::TEST_DIR
|
115
|
+
config[:gemfile] ||= {}
|
116
|
+
use_database = (config[:database] and config[:database] != {})
|
117
|
+
|
118
|
+
if use_database
|
119
|
+
gem = get_adapter_gem_from config[:database][:adapter]
|
120
|
+
config[:gemfile][:database_gem] = "# This gem is the adapter we detected for your database connection.\ngem '#{gem}'"
|
121
|
+
end
|
122
|
+
|
123
|
+
|
124
|
+
empty_directory tests_dir
|
125
|
+
directory "../files/generate/ready", "#{tests_dir}"
|
126
|
+
|
127
|
+
template "../files/generate/templates/Gemfile.tt", "#{tests_dir}/Gemfile", config[:gemfile]
|
128
|
+
if use_database
|
129
|
+
template "../files/generate/templates/database.yml.tt", "#{tests_dir}/database.yml", config[:database]
|
130
|
+
end
|
131
|
+
template "../files/generate/templates/spec_helper.rb.tt", "#{tests_dir}/spec_helper.rb", config[:environment]
|
132
|
+
|
133
|
+
say ""
|
134
|
+
say "Your testing suite is ready! You can now make tests in the 'integration' directory."
|
135
|
+
say ""
|
136
|
+
if use_database
|
137
|
+
say "Note: since you entered database information, we created a '.gitignore' file in the tests directory which will ignore the database.yml file by default. This is to prevent accidentally committing your database information to your repository."
|
138
|
+
say ""
|
139
|
+
say "In case you accidentally delete your database.yml file, we left a sample file named 'database.yml.sample' which will help you recreate your database.yml."
|
140
|
+
end
|
141
|
+
end
|
142
|
+
end
|
143
|
+
|
144
|
+
Roadkill.start
|
@@ -0,0 +1 @@
|
|
1
|
+
--color
|
@@ -0,0 +1 @@
|
|
1
|
+
database.yml
|
@@ -0,0 +1,55 @@
|
|
1
|
+
require 'yaml'
|
2
|
+
|
3
|
+
class ActiveRecordConnect
|
4
|
+
attr_accessor :database
|
5
|
+
|
6
|
+
def validate
|
7
|
+
%w[adapter database].each do |key|
|
8
|
+
if @database[key].nil? or @database[key].empty?
|
9
|
+
error_message "If you would like to connect to the database, please populate #{File.expand_path(File.dirname(__FILE__))}/database.yml ."
|
10
|
+
return false
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
14
|
+
|
15
|
+
def get_database_information
|
16
|
+
@database = YAML.load_file('database.yml')['database']
|
17
|
+
end
|
18
|
+
|
19
|
+
def connect
|
20
|
+
get_database_information
|
21
|
+
validate
|
22
|
+
connect!
|
23
|
+
end
|
24
|
+
|
25
|
+
def error_message(message)
|
26
|
+
puts "=" * 50
|
27
|
+
puts message
|
28
|
+
puts "=" * 50
|
29
|
+
end
|
30
|
+
|
31
|
+
def connection_data
|
32
|
+
connection = {}
|
33
|
+
connection[:adapter] = @database["adapter"] if @database["adapter"]
|
34
|
+
connection[:host] = @database["host"] if @database["host"]
|
35
|
+
connection[:username] = @database["username"] if @database["username"]
|
36
|
+
connection[:password] = @database["password"] if @database["password"]
|
37
|
+
connection[:datababase] = @database["database"] if @database["database"]
|
38
|
+
connection
|
39
|
+
end
|
40
|
+
|
41
|
+
def connect!
|
42
|
+
puts "Connect with #{connection_data.inspect}"
|
43
|
+
begin
|
44
|
+
ActiveRecord::Base.establish_connection( connection_data )
|
45
|
+
rescue Exception => e
|
46
|
+
error_message("It appears that your database information is invalid.
|
47
|
+
\rPlease check your configuration in #{File.expand_path(File.dirname(__FILE__))}/database.yml .
|
48
|
+
\rSee the error message below for more information.\r
|
49
|
+
\r\r\r#{e.message}")
|
50
|
+
|
51
|
+
end
|
52
|
+
end
|
53
|
+
end
|
54
|
+
|
55
|
+
ActiveRecordConnect.new.connect
|
@@ -0,0 +1,15 @@
|
|
1
|
+
|
2
|
+
require 'capybara/rspec'
|
3
|
+
require 'capybara/poltergeist'
|
4
|
+
require 'active_record'
|
5
|
+
require 'pry'
|
6
|
+
require './db_connect'
|
7
|
+
|
8
|
+
|
9
|
+
|
10
|
+
include Capybara::DSL
|
11
|
+
Capybara.javascript_driver = Capybara.default_driver = :poltergeist
|
12
|
+
# Please enter the URL which your app can be accessed.
|
13
|
+
|
14
|
+
Capybara.app_host = "<%= config[:uri_port] %>"
|
15
|
+
Capybara.run_server = false
|
@@ -0,0 +1,30 @@
|
|
1
|
+
<!doctype html>
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<style type="text/css">
|
5
|
+
.hidden{
|
6
|
+
display: none;
|
7
|
+
}
|
8
|
+
</style>
|
9
|
+
</head>
|
10
|
+
<body>
|
11
|
+
<div id="login">
|
12
|
+
Please login.
|
13
|
+
<input id="email" type="name" name="email" placeholder="email" />
|
14
|
+
<input id="password" type="password" name="password" />
|
15
|
+
<input id="submit" type="submit" value="Login" />
|
16
|
+
</div>
|
17
|
+
<div id="logged-in" class="hidden">
|
18
|
+
You have been successfully logged in!
|
19
|
+
</div>
|
20
|
+
<script src="http://code.jquery.com/jquery-1.10.1.min.js"></script>
|
21
|
+
<script type="text/javascript">
|
22
|
+
$('#submit').on('click', function(){
|
23
|
+
$('#login').hide();
|
24
|
+
$('#logged-in').show();
|
25
|
+
});
|
26
|
+
</script>
|
27
|
+
|
28
|
+
</body>
|
29
|
+
</html>
|
30
|
+
|
@@ -0,0 +1 @@
|
|
1
|
+
--color
|
@@ -0,0 +1,15 @@
|
|
1
|
+
load './spec_helper.rb'
|
2
|
+
|
3
|
+
feature "Homepage" do
|
4
|
+
scenario "user visits the homepage" do
|
5
|
+
visit "/"
|
6
|
+
page.should have_content "Please login."
|
7
|
+
end
|
8
|
+
scenario "user logs in with valid information" do
|
9
|
+
visit "/"
|
10
|
+
fill_in :email, with: "someone@example.com"
|
11
|
+
fill_in :password, with: "password"
|
12
|
+
click_button :submit
|
13
|
+
page.should have_content "You have been successfully logged in!"
|
14
|
+
end
|
15
|
+
end
|
@@ -0,0 +1,18 @@
|
|
1
|
+
require './spec_helper.rb'
|
2
|
+
|
3
|
+
feature "View the welcome page" do
|
4
|
+
scenario "user sees the welcome page" do
|
5
|
+
visit "/"
|
6
|
+
expect(page).to have_css '.links'
|
7
|
+
end
|
8
|
+
scenario "user clicks the todos link" do
|
9
|
+
visit "/"
|
10
|
+
click_link 'View todos'
|
11
|
+
page.should have_content "Your todos"
|
12
|
+
end
|
13
|
+
scenario "user clicks the alert link" do
|
14
|
+
visit "/"
|
15
|
+
click_link "Alert"
|
16
|
+
page.should have_content "you clicked the alert link!"
|
17
|
+
end
|
18
|
+
end
|
data/lib/roadkill.rb
ADDED
data/models.rb
ADDED
File without changes
|
data/roadkill.gemspec
ADDED
@@ -0,0 +1,28 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require 'roadkill/version'
|
5
|
+
|
6
|
+
Gem::Specification.new do |spec|
|
7
|
+
spec.name = "roadkill"
|
8
|
+
spec.version = Roadkill::VERSION
|
9
|
+
spec.authors = ["Agape Red"]
|
10
|
+
spec.email = ["roadkill@agapered.com"]
|
11
|
+
spec.description = %q{External web testing}
|
12
|
+
spec.summary = %q{This gem allows you to do external testing on any web application - regardless of the language that the application was written in.}
|
13
|
+
spec.homepage = ""
|
14
|
+
spec.license = "MIT"
|
15
|
+
|
16
|
+
spec.files = `git ls-files`.split($/)
|
17
|
+
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
18
|
+
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
19
|
+
spec.require_paths = ["lib"]
|
20
|
+
|
21
|
+
spec.add_development_dependency "bundler", "~> 1.3"
|
22
|
+
spec.add_development_dependency "rake"
|
23
|
+
spec.add_dependency "thor"
|
24
|
+
spec.add_dependency "activerecord"
|
25
|
+
spec.add_dependency "capybara"
|
26
|
+
spec.add_dependency "poltergeist"
|
27
|
+
spec.add_dependency "rspec"
|
28
|
+
end
|
@@ -0,0 +1,15 @@
|
|
1
|
+
#! /bin/bash
|
2
|
+
|
3
|
+
echo "Installing phantom js 64 bit"
|
4
|
+
|
5
|
+
sudo apt-get install fontconfig
|
6
|
+
|
7
|
+
wget https://phantomjs.googlecode.com/files/phantomjs-1.9.0-linux-x86_64.tar.bz2
|
8
|
+
|
9
|
+
bunzip2 phantomjs-1.9.0-linux-x86_64.tar.bz2
|
10
|
+
tar -xf phantomjs-1.9.0-linux-x86_64.tar
|
11
|
+
|
12
|
+
sudo mv phantomjs-1.9.0-linux-x86_64/bin/phantomjs /usr/bin/
|
13
|
+
|
14
|
+
rm phantomjs-1.9.0-linux-x86_64.tar phantomjs-1.9.0-linux-x86_64/ -rf
|
15
|
+
|
data/spec_helper.rb
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
|
2
|
+
#require 'capybara/mechanize'
|
3
|
+
require 'capybara/rspec'
|
4
|
+
require 'capybara/poltergeist'
|
5
|
+
require 'active_record'
|
6
|
+
require 'pry'
|
7
|
+
require './models'
|
8
|
+
|
9
|
+
ActiveRecord::Base.establish_connection({
|
10
|
+
adapter: :postgresql,
|
11
|
+
host: "localhost",
|
12
|
+
username: "postgres",
|
13
|
+
password: "password",
|
14
|
+
datababase: "integration_testing"
|
15
|
+
})
|
16
|
+
|
17
|
+
include Capybara::DSL
|
18
|
+
Capybara.javascript_driver = Capybara.default_driver = :poltergeist
|
19
|
+
Capybara.app_host = "http://localhost:3000"
|
20
|
+
Capybara.run_server = false
|
21
|
+
|
data/todos.txt
ADDED
@@ -0,0 +1,13 @@
|
|
1
|
+
TODOS
|
2
|
+
|
3
|
+
package as gem and release on rubygems
|
4
|
+
|
5
|
+
testing
|
6
|
+
=======
|
7
|
+
make sure that mysql and postgres connections will work
|
8
|
+
- they may not be using the correct gems and adapter information.
|
9
|
+
- if they are not working, fix the "gemfile" entries in the generate method in the roadkill bin
|
10
|
+
|
11
|
+
low priority
|
12
|
+
============
|
13
|
+
specifics for database.yml generation, such as "pool" and "reconnect" for mysql
|
metadata
ADDED
@@ -0,0 +1,174 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: roadkill
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Agape Red
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2013-07-12 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: bundler
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - ~>
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '1.3'
|
20
|
+
type: :development
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ~>
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '1.3'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: rake
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - '>='
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - '>='
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: thor
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - '>='
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '0'
|
48
|
+
type: :runtime
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - '>='
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: activerecord
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - '>='
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
62
|
+
type: :runtime
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - '>='
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '0'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: capybara
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - '>='
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '0'
|
76
|
+
type: :runtime
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - '>='
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '0'
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: poltergeist
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - '>='
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '0'
|
90
|
+
type: :runtime
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - '>='
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: '0'
|
97
|
+
- !ruby/object:Gem::Dependency
|
98
|
+
name: rspec
|
99
|
+
requirement: !ruby/object:Gem::Requirement
|
100
|
+
requirements:
|
101
|
+
- - '>='
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: '0'
|
104
|
+
type: :runtime
|
105
|
+
prerelease: false
|
106
|
+
version_requirements: !ruby/object:Gem::Requirement
|
107
|
+
requirements:
|
108
|
+
- - '>='
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: '0'
|
111
|
+
description: External web testing
|
112
|
+
email:
|
113
|
+
- roadkill@agapered.com
|
114
|
+
executables:
|
115
|
+
- roadkill
|
116
|
+
extensions: []
|
117
|
+
extra_rdoc_files: []
|
118
|
+
files:
|
119
|
+
- .gitignore
|
120
|
+
- Gemfile
|
121
|
+
- Gemfile.lock
|
122
|
+
- LICENSE.txt
|
123
|
+
- README.md
|
124
|
+
- Rakefile
|
125
|
+
- bin/roadkill
|
126
|
+
- files/generate/.rspec
|
127
|
+
- files/generate/ready/.gitignore
|
128
|
+
- files/generate/ready/database.yml.sample
|
129
|
+
- files/generate/ready/db_connect.rb
|
130
|
+
- files/generate/ready/integration/sample_spec.rb
|
131
|
+
- files/generate/ready/spec
|
132
|
+
- files/generate/templates/Gemfile.tt
|
133
|
+
- files/generate/templates/database.yml.tt
|
134
|
+
- files/generate/templates/spec_helper.rb.tt
|
135
|
+
- files/sample_app/config.ru
|
136
|
+
- files/sample_app/home.html
|
137
|
+
- files/sample_app/tests/.rspec
|
138
|
+
- files/sample_app/tests/integration/homepage_spec.rb
|
139
|
+
- files/sample_app/todo_app.rb
|
140
|
+
- integration/welcome_spec.rb
|
141
|
+
- lib/roadkill.rb
|
142
|
+
- lib/roadkill/version.rb
|
143
|
+
- models.rb
|
144
|
+
- roadkill.gemspec
|
145
|
+
- setup/install_phantomjs_64bit.sh
|
146
|
+
- spec
|
147
|
+
- spec_helper.rb
|
148
|
+
- todos.txt
|
149
|
+
homepage: ''
|
150
|
+
licenses:
|
151
|
+
- MIT
|
152
|
+
metadata: {}
|
153
|
+
post_install_message:
|
154
|
+
rdoc_options: []
|
155
|
+
require_paths:
|
156
|
+
- lib
|
157
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
158
|
+
requirements:
|
159
|
+
- - '>='
|
160
|
+
- !ruby/object:Gem::Version
|
161
|
+
version: '0'
|
162
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
163
|
+
requirements:
|
164
|
+
- - '>='
|
165
|
+
- !ruby/object:Gem::Version
|
166
|
+
version: '0'
|
167
|
+
requirements: []
|
168
|
+
rubyforge_project:
|
169
|
+
rubygems_version: 2.0.5
|
170
|
+
signing_key:
|
171
|
+
specification_version: 4
|
172
|
+
summary: This gem allows you to do external testing on any web application - regardless
|
173
|
+
of the language that the application was written in.
|
174
|
+
test_files: []
|