farmer 0.5.1 → 1.0

Sign up to get free protection for your applications and to get access to all the features.
data/README ADDED
@@ -0,0 +1,6 @@
1
+ Hello all,
2
+
3
+ Farmer has been renamed to cucumber-farmer.
4
+ The repo has moved to http://github.com/mattscilipoti/cucumber-farmer
5
+
6
+ -matt
metadata CHANGED
@@ -1,12 +1,12 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: farmer
3
3
  version: !ruby/object:Gem::Version
4
+ hash: 15
4
5
  prerelease: false
5
6
  segments:
6
- - 0
7
- - 5
8
7
  - 1
9
- version: 0.5.1
8
+ - 0
9
+ version: "1.0"
10
10
  platform: ruby
11
11
  authors:
12
12
  - Matt Scilipoti
@@ -14,75 +14,20 @@ autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
16
 
17
- date: 2010-05-03 00:00:00 -04:00
17
+ date: 2010-08-27 00:00:00 -04:00
18
18
  default_executable:
19
- dependencies:
20
- - !ruby/object:Gem::Dependency
21
- name: mattscilipoti-rdialog
22
- prerelease: false
23
- requirement: &id001 !ruby/object:Gem::Requirement
24
- requirements:
25
- - - "="
26
- - !ruby/object:Gem::Version
27
- segments:
28
- - 0
29
- - 6
30
- - 1
31
- version: 0.6.1
32
- type: :runtime
33
- version_requirements: *id001
34
- - !ruby/object:Gem::Dependency
35
- name: cucumber
36
- prerelease: false
37
- requirement: &id002 !ruby/object:Gem::Requirement
38
- requirements:
39
- - - ">="
40
- - !ruby/object:Gem::Version
41
- segments:
42
- - 0
43
- - 6
44
- version: "0.6"
45
- type: :development
46
- version_requirements: *id002
47
- - !ruby/object:Gem::Dependency
48
- name: shoulda
49
- prerelease: false
50
- requirement: &id003 !ruby/object:Gem::Requirement
51
- requirements:
52
- - - ">="
53
- - !ruby/object:Gem::Version
54
- segments:
55
- - 2
56
- - 10
57
- version: "2.10"
58
- type: :development
59
- version_requirements: *id003
60
- description: "A library of cucumber step definitions, which allow you to use a human to assert conditions during acceptance tests.\n For instance... we needed to verify that certain portions of an image were 'blacked out'.\n This is very difficult to assert using automation. However, it is easy for a human.\n Farmer allows us to include human confirmation into our normal testing flow.\n "
19
+ dependencies: []
20
+
21
+ description: "farmer has been renamed to cucumber-farmer. http://github.com/mattscilipoti/cucumber-farmer "
61
22
  email: matt@scilipoti.name
62
23
  executables: []
63
24
 
64
25
  extensions: []
65
26
 
66
27
  extra_rdoc_files:
67
- - LICENSE
68
- - README.rdoc
28
+ - README
69
29
  files:
70
- - .document
71
- - .gitignore
72
- - LICENSE
73
- - README.rdoc
74
- - Rakefile
75
- - VERSION
76
- - farmer.gemspec
77
- - lib/farmer.rb
78
- - lib/farmer_step_definitions.rb
79
- - lib/step_definitions/dialog_steps.rb
80
- - test/helper.rb
81
- - test_app/features/home_page.feature
82
- - test_app/features/human_confirmation.feature
83
- - test_app/features/step_definitions/web_steps.rb
84
- - test_app/features/support/env.rb
85
- - test_app/test_app.rb
30
+ - README
86
31
  has_rdoc: true
87
32
  homepage: http://github.com/mattscilipoti/farmer
88
33
  licenses: []
@@ -93,25 +38,29 @@ rdoc_options:
93
38
  require_paths:
94
39
  - lib
95
40
  required_ruby_version: !ruby/object:Gem::Requirement
41
+ none: false
96
42
  requirements:
97
43
  - - ">="
98
44
  - !ruby/object:Gem::Version
45
+ hash: 3
99
46
  segments:
100
47
  - 0
101
48
  version: "0"
102
49
  required_rubygems_version: !ruby/object:Gem::Requirement
50
+ none: false
103
51
  requirements:
104
52
  - - ">="
105
53
  - !ruby/object:Gem::Version
54
+ hash: 3
106
55
  segments:
107
56
  - 0
108
57
  version: "0"
109
58
  requirements: []
110
59
 
111
60
  rubyforge_project:
112
- rubygems_version: 1.3.6
61
+ rubygems_version: 1.3.7
113
62
  signing_key:
114
63
  specification_version: 3
115
- summary: A library of cucumber step definitions, which allow you to use a human to assert conditions during acceptance tests.
116
- test_files:
117
- - test/helper.rb
64
+ summary: farmer has been renamed to cucumber-farmer. http://github.com/mattscilipoti/cucumber-farmer
65
+ test_files: []
66
+
data/.document DELETED
@@ -1,5 +0,0 @@
1
- README.rdoc
2
- lib/**/*.rb
3
- bin/*
4
- features/**/*.feature
5
- LICENSE
data/.gitignore DELETED
@@ -1,24 +0,0 @@
1
- ## MAC OS
2
- .DS_Store
3
-
4
- ## TEXTMATE
5
- *.tmproj
6
- tmtags
7
-
8
- ## EMACS
9
- *~
10
- \#*
11
- .\#*
12
-
13
- ## VIM
14
- *.swp
15
-
16
- ## RUBYMINE
17
- .idea
18
-
19
- ## PROJECT::GENERAL
20
- coverage
21
- rdoc
22
- pkg
23
-
24
- ## PROJECT::SPECIFIC
data/LICENSE DELETED
@@ -1,20 +0,0 @@
1
- Copyright (c) 2009 Matt Scilipoti
2
-
3
- Permission is hereby granted, free of charge, to any person obtaining
4
- a copy of this software and associated documentation files (the
5
- "Software"), to deal in the Software without restriction, including
6
- without limitation the rights to use, copy, modify, merge, publish,
7
- distribute, sublicense, and/or sell copies of the Software, and to
8
- permit persons to whom the Software is furnished to do so, subject to
9
- the following conditions:
10
-
11
- The above copyright notice and this permission notice shall be
12
- included in all copies or substantial portions of the Software.
13
-
14
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
- NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
- LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
- OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
- WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -1,80 +0,0 @@
1
- = farmer
2
-
3
- A library of cucumber step definitions, which allow you to use a human to assert conditions during acceptance tests.
4
-
5
- == Why?
6
- We needed to verify that certain portions of an image were 'blacked out'.
7
- This is very difficult to assert using automation. However, it is easy for a human.
8
- Farmer allows us to include human confirmation into our normal testing flow.
9
-
10
- == What?
11
- Farmer utilizes rdialog to allow you to:
12
- * Present messages
13
- * Display files
14
- * Ask a human for confirmation
15
-
16
- == Example
17
- When I display the message "Please review the following images. \nEnsure 'Frame' and 'Speed Data' items are hidden."
18
- And I display these Files:
19
- |filename|
20
- |images/processed_a.jpg|
21
- |images/processed_b.jpg|
22
-
23
- Then I should say "'Frame' item is hidden in all images"
24
- Then I should say "'Speed Data' item is hidden in all images"
25
-
26
- This will:
27
- * Display an info box to the user, informing them of the upcoming test, then...
28
- * Open a new page in firefox to display the named files (in tabs).
29
- * Once the user closes all the tabs, confirmation dialogs will be displayed.
30
-
31
- == Installation
32
- $ apt-get install dialog
33
- $ gem install farmer
34
-
35
- In features/support/env.rb:
36
- require 'farmer_step_definitions'
37
-
38
- == Test
39
- Two levels of testing are required. Library testing and 'usage as a gem' testing.
40
- ==== Usage as gem:
41
- A (sinatra) test app is included, containing some acceptance tests.
42
- Interestingly, these tests ask you to verify farmer's functionality.
43
-
44
- cd test_app
45
- cucumber
46
-
47
- ==== Test the library:
48
- This library was extracted from an existing app.
49
- It was created test-first (mostly), but extracting the tests is harder than extracting code.
50
- Test are added regularly.
51
- rake
52
-
53
- == Questions?
54
- * Check out step_definitions/dialog_steps.
55
-
56
- == Issues?
57
- * Create an issue on github (http://github.com/mattscilipoti/farmer/issues???)
58
-
59
- == TODO:
60
- * expand test coverage to unit tests
61
- * add step_definitions to rdoc.
62
- * utilize pickle foundation.
63
- * make dialog timeout configurable.
64
- * namespace
65
-
66
- == Note on Patches/Pull Requests
67
- * Fork the project.
68
- * Please, do not mess with rakefile or version files.
69
- * Since you will probably want to utilize your own copy, while waiting for upstream to include your pull request,
70
- I recommend creating a branch named 'upstream'.
71
- * Make your changes in a topic and merge them into 'master' and 'upstream'.
72
- This way, 'master' can have your readme, version, etc.
73
- * Add tests for it. This is important. I don't want break it in a
74
- future version unintentionally.
75
- * Commit.
76
- * Send me a pull request from 'upstream' or the topic branch.
77
-
78
- == Copyright
79
-
80
- Copyright (c) 2010 Matt Scilipoti. See LICENSE for details.
data/Rakefile DELETED
@@ -1,59 +0,0 @@
1
- require 'rubygems'
2
- require 'rake'
3
-
4
- begin
5
- require 'jeweler'
6
- Jeweler::Tasks.new do |gem|
7
- gem.name = "farmer"
8
- gem.summary = 'A library of cucumber step definitions, which allow you to use a human to assert conditions during acceptance tests.'
9
- gem.description = %Q{A library of cucumber step definitions, which allow you to use a human to assert conditions during acceptance tests.
10
- For instance... we needed to verify that certain portions of an image were 'blacked out'.
11
- This is very difficult to assert using automation. However, it is easy for a human.
12
- Farmer allows us to include human confirmation into our normal testing flow.
13
- }
14
- gem.email = "matt@scilipoti.name"
15
- gem.homepage = "http://github.com/mattscilipoti/farmer"
16
- gem.authors = ["Matt Scilipoti"]
17
- gem.add_dependency('mattscilipoti-rdialog', '0.6.1')
18
- gem.add_development_dependency "cucumber", ">= 0.6"
19
- gem.add_development_dependency "shoulda", ">= 2.10"
20
- # gem is a Gem::Specification... see http://www.rubygems.org/read/chapter/20 for additional settings
21
- end
22
- Jeweler::GemcutterTasks.new
23
- rescue LoadError
24
- puts "Jeweler (or a dependency) not available. Install it with: gem install jeweler"
25
- end
26
-
27
- require 'rake/testtask'
28
- Rake::TestTask.new(:test) do |test|
29
- test.libs << 'lib' << 'test'
30
- test.pattern = 'test/**/test_*.rb'
31
- test.verbose = true
32
- end
33
-
34
- begin
35
- require 'rcov/rcovtask'
36
- Rcov::RcovTask.new do |test|
37
- test.libs << 'test'
38
- test.pattern = 'test/**/test_*.rb'
39
- test.verbose = true
40
- end
41
- rescue LoadError
42
- task :rcov do
43
- abort "RCov is not available. In order to run rcov, you must: sudo gem install spicycode-rcov"
44
- end
45
- end
46
-
47
- task :test => :check_dependencies
48
-
49
- task :default => :test
50
-
51
- require 'rake/rdoctask'
52
- Rake::RDocTask.new do |rdoc|
53
- version = File.exist?('VERSION') ? File.read('VERSION') : ""
54
-
55
- rdoc.rdoc_dir = 'rdoc'
56
- rdoc.title = "farmer #{version}"
57
- rdoc.rdoc_files.include('README*')
58
- rdoc.rdoc_files.include('lib/**/*.rb')
59
- end
data/VERSION DELETED
@@ -1 +0,0 @@
1
- 0.5.1
@@ -1,69 +0,0 @@
1
- # Generated by jeweler
2
- # DO NOT EDIT THIS FILE DIRECTLY
3
- # Instead, edit Jeweler::Tasks in Rakefile, and run the gemspec command
4
- # -*- encoding: utf-8 -*-
5
-
6
- Gem::Specification.new do |s|
7
- s.name = %q{farmer}
8
- s.version = "0.5.1"
9
-
10
- s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
- s.authors = ["Matt Scilipoti"]
12
- s.date = %q{2010-05-03}
13
- s.description = %q{A library of cucumber step definitions, which allow you to use a human to assert conditions during acceptance tests.
14
- For instance... we needed to verify that certain portions of an image were 'blacked out'.
15
- This is very difficult to assert using automation. However, it is easy for a human.
16
- Farmer allows us to include human confirmation into our normal testing flow.
17
- }
18
- s.email = %q{matt@scilipoti.name}
19
- s.extra_rdoc_files = [
20
- "LICENSE",
21
- "README.rdoc"
22
- ]
23
- s.files = [
24
- ".document",
25
- ".gitignore",
26
- "LICENSE",
27
- "README.rdoc",
28
- "Rakefile",
29
- "VERSION",
30
- "farmer.gemspec",
31
- "lib/farmer.rb",
32
- "lib/farmer_step_definitions.rb",
33
- "lib/step_definitions/dialog_steps.rb",
34
- "test/helper.rb",
35
- "test_app/features/home_page.feature",
36
- "test_app/features/human_confirmation.feature",
37
- "test_app/features/step_definitions/web_steps.rb",
38
- "test_app/features/support/env.rb",
39
- "test_app/test_app.rb"
40
- ]
41
- s.homepage = %q{http://github.com/mattscilipoti/farmer}
42
- s.rdoc_options = ["--charset=UTF-8"]
43
- s.require_paths = ["lib"]
44
- s.rubygems_version = %q{1.3.6}
45
- s.summary = %q{A library of cucumber step definitions, which allow you to use a human to assert conditions during acceptance tests.}
46
- s.test_files = [
47
- "test/helper.rb"
48
- ]
49
-
50
- if s.respond_to? :specification_version then
51
- current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
52
- s.specification_version = 3
53
-
54
- if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
55
- s.add_runtime_dependency(%q<mattscilipoti-rdialog>, ["= 0.6.1"])
56
- s.add_development_dependency(%q<cucumber>, [">= 0.6"])
57
- s.add_development_dependency(%q<shoulda>, [">= 2.10"])
58
- else
59
- s.add_dependency(%q<mattscilipoti-rdialog>, ["= 0.6.1"])
60
- s.add_dependency(%q<cucumber>, [">= 0.6"])
61
- s.add_dependency(%q<shoulda>, [">= 2.10"])
62
- end
63
- else
64
- s.add_dependency(%q<mattscilipoti-rdialog>, ["= 0.6.1"])
65
- s.add_dependency(%q<cucumber>, [">= 0.6"])
66
- s.add_dependency(%q<shoulda>, [">= 2.10"])
67
- end
68
- end
69
-
File without changes
@@ -1,2 +0,0 @@
1
- cur_dir = File.expand_path('step_definitions', File.dirname(__FILE__))
2
- require File.join(cur_dir, 'dialog_steps')
@@ -1,84 +0,0 @@
1
- begin
2
- gem 'mattscilipoti-rdialog', '>=0.5.0'
3
- require 'mattscilipoti-rdialog'
4
- rescue LoadError
5
- puts "REQUIRED: dialog & rdialog are required.\n `sudo apt-get install dialog`\n `gem install mattscilipoti-rdialog`"
6
- exit
7
- end
8
-
9
- # When I display the message "message goes here"'
10
- #Displays info box containing the message
11
- When /^I display the message "([^\"]*)"$/ do |message|
12
- dialog = RDialog.new
13
- dialog.infobox(message)
14
- end
15
-
16
- When /^I display these Files:$/ do |table|
17
- files = table.rows.collect { |row| row[0] }
18
-
19
- view_in_firefox(*files)
20
- end
21
-
22
- def dialog_timeout
23
- 5 #seconds
24
- end
25
-
26
- # Then I should say "confirmation request goes here"'
27
- #Displays a dialog box containing the message
28
- #User response is used to pass/fail the test
29
- #Cancel/No fails test
30
- Then /^I should say "([^\"]*)"$/ do |question|
31
- response = nil
32
- dialog = RDialog.new
33
- dialog.timeout = dialog_timeout
34
- msg = %Q{#{question}?
35
-
36
- This dialog will timeout after #{dialog_timeout} secs.}
37
- response = dialog.yesno(question + '?')
38
-
39
- response.should be_true
40
- end
41
-
42
- # Given these warnings are displayed:
43
- # |dialog |
44
- # |firefox|
45
- # Displays named warnings to humans.
46
- # dialog: inform them that their input will be requested
47
- # firefox: specifies firefox requirements.
48
- Given /^(?:these warnings are|this warning is) displayed:$/ do |table|
49
- table.raw.flatten.inject(warnings = []) do |warning_messages, warning_name|
50
- msg = warning_for(warning_name)
51
- warning_messages << msg
52
- end
53
-
54
- dialog = RDialog.new
55
- dialog.timeout = 30 #seconds
56
- dialog.msgbox(warnings.join('\n--------------------------\n'))
57
- end
58
-
59
- def dialog_warning
60
- <<WARN
61
- Dialog Warning: Some of these scenarios will ask you to manually verify steps.
62
- Yes/No dialogs will timeout after #{dialog_timeout} secs.
63
-
64
- test
65
- WARN
66
- end
67
-
68
- def firefox_warning
69
- <<WARN
70
- Firefox Notice: profile 'cucumber' expected.\n
71
- If this profile doesn't exist, ProfileManager will automatically be displayed so you can add it (or use 'firefox -ProfileManager')
72
- To ensure tests wait until Firefox is closed, please ensure ALL instances of Firefox using the 'cu Profile are closed.
73
- You can leave instances from other profiles open.
74
- WARN
75
- end
76
-
77
- def view_in_firefox(*files)
78
- file_args = files.join(' ')
79
- `firefox -P cucumber -no-remote #{file_args}`
80
- end
81
-
82
- def warning_for(identifier)
83
- send("#{identifier.to_s}_warning")
84
- end
@@ -1,10 +0,0 @@
1
- require 'rubygems'
2
- require 'test/unit'
3
- require 'shoulda'
4
-
5
- $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
6
- $LOAD_PATH.unshift(File.dirname(__FILE__))
7
- require 'farmer'
8
-
9
- class Test::Unit::TestCase
10
- end
@@ -1,5 +0,0 @@
1
- Feature : Home Page experience
2
-
3
- Scenario: See hello world
4
- When I visit the home page
5
- Then I should see "Hello World"
@@ -1,27 +0,0 @@
1
- Feature: Humans can confirm test results
2
-
3
- In order to ensure that humans can be utilized and incorporated into acceptance testing flow
4
- As a human tester
5
- I want be able to receive information and provide feedback
6
-
7
- Scenario: Basic Yes/No Dialog
8
- Then I should say "I can see a yes/no dialog box"
9
-
10
- Scenario: Info Box
11
- When I display the message "TEST MESSAGE. Please close me."
12
- Then I should say "I saw the 'TEST MESSAGE'"
13
-
14
- Scenario: Single Warning (dialog)
15
- Given this warning is displayed:
16
- |dialog|
17
-
18
- Then I should say "I am aware that dialogs will used for manual verification"
19
-
20
- Scenario: Multiple warnings (dialog & firefox)
21
- Given these warnings are displayed:
22
- |dialog|
23
- |firefox|
24
-
25
- Then I should say "I am aware that dialogs will used for manual verification"
26
- Then I should say "I saw an informational warning about firefox requirements"
27
-
@@ -1,7 +0,0 @@
1
- When /^I visit the home page$/ do
2
- visit '/'
3
- end
4
-
5
- Then /^I should see "([^\"]*)"$/ do |text|
6
- assert_contain text
7
- end
@@ -1,37 +0,0 @@
1
- # See http://wiki.github.com/aslakhellesoy/cucumber/sinatra
2
- # for more details about Sinatra with Cucumber
3
-
4
- app_file = File.expand_path('../../test_app', File.dirname(__FILE__))
5
- require app_file
6
-
7
- # Force the application name because polyglot breaks the auto-detection logic.
8
- Sinatra::Application.app_file = app_file
9
-
10
- gem 'rack-test', '>=0.5.0'
11
- require 'test/unit/assertions'
12
- require 'rack/test'
13
- require 'webrat'
14
-
15
- Webrat.configure do |config|
16
- config.mode = :rack
17
- end
18
-
19
- class TestAppWorld
20
- include Test::Unit::Assertions
21
- include Rack::Test::Methods
22
- include Webrat::Methods
23
- include Webrat::Matchers
24
- # Webrat::Methods.delegate_to_session :response_code, :response_body
25
-
26
- def app
27
- Sinatra::Application
28
- end
29
- end
30
-
31
- #add farmer lib to load path (like gem command would do)
32
- farmer_lib_path = File.expand_path('../../../lib/', File.dirname(__FILE__))
33
- $LOAD_PATH.unshift farmer_lib_path
34
-
35
- require 'farmer_step_definitions'
36
-
37
- World { TestAppWorld.new }
@@ -1,7 +0,0 @@
1
- require 'rubygems'
2
-
3
- gem 'sinatra', '=1.0'
4
- require 'sinatra'
5
- get '/' do
6
- 'Hello World'
7
- end