squash 0.0.2 → 0.0.3

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 CHANGED
@@ -1,3 +1,4 @@
1
1
  squash-*.gem
2
2
  **/.DS_Store
3
3
  .rvmrc
4
+ template/Gemfile.lock
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- squash (0.0.2)
4
+ squash (0.0.3)
5
5
  akephalos
6
6
  cucumber
7
7
  rspec
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
- ## Install
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
- gem install squash
11
+ ## Current status
12
12
 
13
- ## Contribute
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 "Build the Squash gem"
9
- task :build do
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 "Install the current project as a gem"
14
- task :install => :build do
15
- system "gem install squash-#{Squash::VERSION}.gem"
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
@@ -1,7 +1,6 @@
1
1
  #!/usr/bin/env ruby
2
2
 
3
3
  template_dir = File.expand_path(File.dirname(__FILE__)) + "/../template"
4
- puts template_dir
5
4
 
6
5
  if ARGV.size != 1
7
6
  puts "Create a new empty application with: squash <application_name>"
@@ -1,4 +1,7 @@
1
1
  Given /^I'm in an empty directory$/ do
2
+ require 'fileutils'
2
3
  require 'tmpdir'
3
- Dir.chdir Dir.tmpdir
4
+ FileUtils.rm_rf "#{Dir.tmpdir}/squash"
5
+ FileUtils.mkdir "#{Dir.tmpdir}/squash"
6
+ Dir.chdir "#{Dir.tmpdir}/squash"
4
7
  end
@@ -1,5 +1,5 @@
1
1
  module Squash
2
2
  unless defined?(Squash::VERSION)
3
- VERSION = '0.0.2'
3
+ VERSION = '0.0.3'
4
4
  end
5
5
  end
@@ -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
@@ -0,0 +1,10 @@
1
+ require 'bundler/setup'
2
+
3
+ require 'akephalos'
4
+ Capybara.default_driver = :akephalos
5
+
6
+ #After do
7
+ # Capybara.reset_sessions!
8
+ #end
9
+
10
+ require 'squash/web_steps'
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
- # s.require_paths = "lib"
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 'cucumber'
4
- gem 'rspec'
5
- # gem 'capybara' # at the moment, version conflict with the capybara required by akephalos
6
- gem 'akephalos'
7
- gem 'syntax' # Colored sintax in Cucumber's HTML output
8
- #gem 'squash'
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 see a basic scenario running in a new Squash application
4
- So that I know that the entire stack is working
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 go to RubyGems.org
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"
@@ -0,0 +1,2 @@
1
+ Given /^I'm new to Squash$/ do
2
+ end
@@ -1,9 +1,4 @@
1
1
  require 'rubygems'
2
- require 'bundler/setup'
3
2
 
4
- require 'akephalos'
5
- Capybara.default_driver = :akephalos
6
-
7
- #After do
8
- # Capybara.reset_sessions!
9
- #end
3
+ require File.expand_path(File.join(File.dirname(__FILE__), "paths"))
4
+ require 'squash'
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 0
8
- - 2
9
- version: 0.0.2
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/web_steps.rb
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: -2093033028883756272
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: -2093033028883756272
152
+ hash: -1112585070627610381
152
153
  segments:
153
154
  - 0
154
155
  version: "0"
@@ -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