squash 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +1 -0
- data/Gemfile.lock +1 -1
- data/README.markdown +24 -4
- data/Rakefile +10 -5
- data/bin/squash +0 -1
- data/features/step_definitions/squash_steps.rb +4 -1
- data/lib/squash/version.rb +1 -1
- data/lib/squash/web_steps.rb +27 -0
- data/lib/squash.rb +10 -0
- data/squash.gemspec +1 -1
- data/template/Gemfile +6 -6
- data/template/features/smoke_test.feature +4 -3
- data/template/step_definitions/example_steps.rb +2 -0
- data/template/support/env.rb +2 -7
- metadata +7 -6
- data/template/Gemfile.lock +0 -63
- data/template/step_definitions/web_steps.rb +0 -47
data/.gitignore
CHANGED
data/Gemfile.lock
CHANGED
data/README.markdown
CHANGED
@@ -4,12 +4,32 @@ A test application framework
|
|
4
4
|
|
5
5
|
## Description
|
6
6
|
|
7
|
-
|
7
|
+
I spent a huge amount of time building Cucumber-based stacks to test my web applications. There are so many options, and sometimes they don't really get together. Should I use Cucumber/RSpec/Webrat/Mechanize, Cucumber/RSpec/Capybara/Selenium, Cucumber/Watir, or what else? How do I solve all the version conflicts that seem to spring out of nowhere when I put these libraries together? How do I wire up all the pieces in a stand-alone, non-Rails application?
|
8
8
|
|
9
|
-
|
9
|
+
Squash tries to save some time by generating a Cucumber-powered, Bundler-enabled web test application that is fully wired with the current popular favorite mix of gems: Cucumber, RSpec, Capybara and Akephalos. Once you've generated the Squash application, you can write your own features to
|
10
10
|
|
11
|
-
|
11
|
+
## Current status
|
12
12
|
|
13
|
-
|
13
|
+
Experimental. This is just something that I'm trying out now for my own projects. At the moment, it should (might?) just give you an empty application with a working stack right now.
|
14
|
+
|
15
|
+
## Install Squash
|
16
|
+
|
17
|
+
sudo gem install squash
|
18
|
+
|
19
|
+
## Generate a Squash application
|
20
|
+
|
21
|
+
squash <application_name>
|
22
|
+
|
23
|
+
Move to the application directory and install the entire stack of gems:
|
24
|
+
|
25
|
+
bundle install
|
26
|
+
|
27
|
+
Now check that the thing is working:
|
28
|
+
|
29
|
+
bundle exec cucumber
|
30
|
+
|
31
|
+
Time to write your own features!
|
32
|
+
|
33
|
+
## Contribute to Squash
|
14
34
|
|
15
35
|
* [http://github.com/nusco/squash](http://github.com/nusco/squash)
|
data/Rakefile
CHANGED
@@ -5,13 +5,18 @@ $LOAD_PATH.unshift File.expand_path("../lib", __FILE__)
|
|
5
5
|
require 'squash/version'
|
6
6
|
|
7
7
|
namespace :gem do
|
8
|
-
desc "
|
9
|
-
task :
|
8
|
+
desc "Install the current version as a local gem"
|
9
|
+
task :install do
|
10
10
|
system "gem build squash.gemspec"
|
11
|
+
system "gem install squash-#{Squash::VERSION}.gem"
|
12
|
+
File.delete "squash-#{Squash::VERSION}.gem"
|
11
13
|
end
|
12
14
|
|
13
|
-
desc "
|
14
|
-
task :
|
15
|
-
system "
|
15
|
+
desc "Publish the current version to the world"
|
16
|
+
task :publish do
|
17
|
+
system "bundle exec cucumber -q"
|
18
|
+
system "gem build squash.gemspec"
|
19
|
+
system "gem push squash-#{Squash::VERSION}.gem"
|
20
|
+
File.delete "squash-#{Squash::VERSION}.gem"
|
16
21
|
end
|
17
22
|
end
|
data/bin/squash
CHANGED
data/lib/squash/version.rb
CHANGED
@@ -0,0 +1,27 @@
|
|
1
|
+
Given /^(?:|I )am on (.+)$/ do |page_name|
|
2
|
+
visit path_to(page_name)
|
3
|
+
end
|
4
|
+
|
5
|
+
When /^(?:|I )go to (.+)$/ do |page_name|
|
6
|
+
visit path_to(page_name)
|
7
|
+
end
|
8
|
+
|
9
|
+
When /^(?:|I )fill in "([^\"]*)" with "([^\"]*)"$/ do |field, value|
|
10
|
+
fill_in(field, :with => value)
|
11
|
+
end
|
12
|
+
|
13
|
+
When /^(?:|I )press "([^\"]*)"$/ do |button|
|
14
|
+
click_button(button)
|
15
|
+
end
|
16
|
+
|
17
|
+
When /^(?:|I )follow "([^\"]*)"$/ do |link|
|
18
|
+
click_link(link)
|
19
|
+
end
|
20
|
+
|
21
|
+
Then /^(?:|I )should see "([^\"]*)"$/ do |text|
|
22
|
+
page.should have_content(text)
|
23
|
+
end
|
24
|
+
|
25
|
+
Then /^(?:|I )should not see "([^\"]*)"$/ do |text|
|
26
|
+
page.should_not have_content(text)
|
27
|
+
end
|
data/lib/squash.rb
ADDED
data/squash.gemspec
CHANGED
@@ -7,7 +7,7 @@ Gem::Specification.new do |s|
|
|
7
7
|
s.authors = ['Paolo "Nusco" Perrotta']
|
8
8
|
s.description = 'A test application framework'
|
9
9
|
s.summary = "..."
|
10
|
-
|
10
|
+
s.require_path = "lib"
|
11
11
|
s.email = 'paolo.nusco.perrotta@gmail.com'
|
12
12
|
s.homepage = 'https://github.com/nusco/squash'
|
13
13
|
s.bindir = 'bin'
|
data/template/Gemfile
CHANGED
@@ -1,8 +1,8 @@
|
|
1
1
|
source :rubygems
|
2
2
|
|
3
|
-
gem '
|
4
|
-
gem '
|
5
|
-
|
6
|
-
gem 'akephalos
|
7
|
-
gem '
|
8
|
-
|
3
|
+
gem 'squash' , '= 0.0.3'
|
4
|
+
gem 'cucumber' , '~> 0.10.0'
|
5
|
+
gem 'rspec' , '~> 2.3.0'
|
6
|
+
gem 'capybara' , '~> 0.4.0' # at the moment, version conflict with the capybara required by akephalos
|
7
|
+
gem 'akephalos' , '~> 0.2.4'
|
8
|
+
gem 'syntax' , '~> 1.0.0' # Colored sintax in Cucumber's HTML output
|
@@ -1,10 +1,11 @@
|
|
1
1
|
Feature: This is a smoke test
|
2
2
|
As a developer
|
3
|
-
I want to
|
4
|
-
So that I
|
3
|
+
I want to run a smoke-test scenario in this brand new Squash app
|
4
|
+
So that I can verify that the entire stack works
|
5
5
|
|
6
6
|
Scenario: Search on RubyGems
|
7
|
-
Given I
|
7
|
+
Given I'm new to Squash
|
8
|
+
And I go to RubyGems.org
|
8
9
|
And I fill in "query" with "squash"
|
9
10
|
And I press "Search"
|
10
11
|
Then I should see "A test application framework"
|
data/template/support/env.rb
CHANGED
metadata
CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
|
|
5
5
|
segments:
|
6
6
|
- 0
|
7
7
|
- 0
|
8
|
-
-
|
9
|
-
version: 0.0.
|
8
|
+
- 3
|
9
|
+
version: 0.0.3
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- Paolo "Nusco" Perrotta
|
@@ -116,13 +116,14 @@ files:
|
|
116
116
|
- features/run_empty_scaffold_application.feature
|
117
117
|
- features/step_definitions/squash_steps.rb
|
118
118
|
- features/support/env.rb
|
119
|
+
- lib/squash.rb
|
119
120
|
- lib/squash/version.rb
|
121
|
+
- lib/squash/web_steps.rb
|
120
122
|
- squash.gemspec
|
121
123
|
- template/Gemfile
|
122
|
-
- template/Gemfile.lock
|
123
124
|
- template/cucumber.yaml
|
124
125
|
- template/features/smoke_test.feature
|
125
|
-
- template/step_definitions/
|
126
|
+
- template/step_definitions/example_steps.rb
|
126
127
|
- template/support/env.rb
|
127
128
|
- template/support/paths.rb
|
128
129
|
has_rdoc: true
|
@@ -139,7 +140,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
139
140
|
requirements:
|
140
141
|
- - ">="
|
141
142
|
- !ruby/object:Gem::Version
|
142
|
-
hash: -
|
143
|
+
hash: -1112585070627610381
|
143
144
|
segments:
|
144
145
|
- 0
|
145
146
|
version: "0"
|
@@ -148,7 +149,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
148
149
|
requirements:
|
149
150
|
- - ">="
|
150
151
|
- !ruby/object:Gem::Version
|
151
|
-
hash: -
|
152
|
+
hash: -1112585070627610381
|
152
153
|
segments:
|
153
154
|
- 0
|
154
155
|
version: "0"
|
data/template/Gemfile.lock
DELETED
@@ -1,63 +0,0 @@
|
|
1
|
-
GEM
|
2
|
-
remote: http://rubygems.org/
|
3
|
-
specs:
|
4
|
-
akephalos (0.2.4)
|
5
|
-
capybara (~> 0.3.8)
|
6
|
-
jruby-jars
|
7
|
-
builder (3.0.0)
|
8
|
-
capybara (0.3.9)
|
9
|
-
culerity (>= 0.2.4)
|
10
|
-
mime-types (>= 1.16)
|
11
|
-
nokogiri (>= 1.3.3)
|
12
|
-
rack (>= 1.0.0)
|
13
|
-
rack-test (>= 0.5.4)
|
14
|
-
selenium-webdriver (>= 0.0.3)
|
15
|
-
childprocess (0.1.4)
|
16
|
-
ffi (~> 0.6.3)
|
17
|
-
cucumber (0.10.0)
|
18
|
-
builder (>= 2.1.2)
|
19
|
-
diff-lcs (~> 1.1.2)
|
20
|
-
gherkin (~> 2.3.2)
|
21
|
-
json (~> 1.4.6)
|
22
|
-
term-ansicolor (~> 1.0.5)
|
23
|
-
culerity (0.2.12)
|
24
|
-
diff-lcs (1.1.2)
|
25
|
-
ffi (0.6.3)
|
26
|
-
rake (>= 0.8.7)
|
27
|
-
gherkin (2.3.2)
|
28
|
-
json (~> 1.4.6)
|
29
|
-
term-ansicolor (~> 1.0.5)
|
30
|
-
jruby-jars (1.5.6)
|
31
|
-
json (1.4.6)
|
32
|
-
json_pure (1.4.6)
|
33
|
-
mime-types (1.16)
|
34
|
-
nokogiri (1.4.4)
|
35
|
-
rack (1.2.1)
|
36
|
-
rack-test (0.5.6)
|
37
|
-
rack (>= 1.0)
|
38
|
-
rake (0.8.7)
|
39
|
-
rspec (2.3.0)
|
40
|
-
rspec-core (~> 2.3.0)
|
41
|
-
rspec-expectations (~> 2.3.0)
|
42
|
-
rspec-mocks (~> 2.3.0)
|
43
|
-
rspec-core (2.3.0)
|
44
|
-
rspec-expectations (2.3.0)
|
45
|
-
diff-lcs (~> 1.1.2)
|
46
|
-
rspec-mocks (2.3.0)
|
47
|
-
rubyzip (0.9.4)
|
48
|
-
selenium-webdriver (0.1.1)
|
49
|
-
childprocess (= 0.1.4)
|
50
|
-
ffi (~> 0.6.3)
|
51
|
-
json_pure
|
52
|
-
rubyzip
|
53
|
-
syntax (1.0.0)
|
54
|
-
term-ansicolor (1.0.5)
|
55
|
-
|
56
|
-
PLATFORMS
|
57
|
-
ruby
|
58
|
-
|
59
|
-
DEPENDENCIES
|
60
|
-
akephalos
|
61
|
-
cucumber
|
62
|
-
rspec
|
63
|
-
syntax
|
@@ -1,47 +0,0 @@
|
|
1
|
-
require File.expand_path(File.join(File.dirname(__FILE__), "..", "support", "paths"))
|
2
|
-
|
3
|
-
Given /^(?:|I )am on (.+)$/ do |page_name|
|
4
|
-
visit path_to(page_name)
|
5
|
-
end
|
6
|
-
|
7
|
-
When /^(?:|I )go to (.+)$/ do |page_name|
|
8
|
-
visit path_to(page_name)
|
9
|
-
end
|
10
|
-
|
11
|
-
When /^(?:|I )fill in "([^\"]*)" with "([^\"]*)"$/ do |field, value|
|
12
|
-
fill_in(field, :with => value)
|
13
|
-
end
|
14
|
-
|
15
|
-
When /^(?:|I )press "([^\"]*)"$/ do |button|
|
16
|
-
click_button(button)
|
17
|
-
end
|
18
|
-
|
19
|
-
When /^(?:|I )follow "([^\"]*)"$/ do |link|
|
20
|
-
click_link(link)
|
21
|
-
end
|
22
|
-
|
23
|
-
Then /^(?:|I )should see "([^\"]*)"$/ do |text|
|
24
|
-
page.should have_content(text)
|
25
|
-
end
|
26
|
-
|
27
|
-
Then /^(?:|I )should not see "([^\"]*)"$/ do |text|
|
28
|
-
page.should_not have_content(text)
|
29
|
-
end
|
30
|
-
|
31
|
-
Then /^(?:|I )should be on (.+)$/ do |page_name|
|
32
|
-
current_path = URI.parse(current_url).select(:path, :query).compact.join('?')
|
33
|
-
path_to(page_name).should =~ /#{current_path}/
|
34
|
-
end
|
35
|
-
|
36
|
-
Then /^(?:|I )should not see spaces around "([^\"]*)"$/ do |text|
|
37
|
-
page.should_not =~ /" #{text}"/
|
38
|
-
page.should_not =~ /"#{text} "/
|
39
|
-
end
|
40
|
-
|
41
|
-
Then /^the "([^\"]*)" field should contain "([^\"]*)"$/ do |field, value|
|
42
|
-
field_labeled(field).value.should =~ /#{value}/
|
43
|
-
end
|
44
|
-
|
45
|
-
Then /^the "([^\"]*)" field should be "([^\"]*)"$/ do |field, value|
|
46
|
-
field_labeled(field).value.should == value
|
47
|
-
end
|