cuke-pack 0.0.1 → 0.0.2

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/README.md CHANGED
@@ -1,29 +1,79 @@
1
- # Cuke::Pack
1
+ # cuke-pack
2
2
 
3
- TODO: Write a gem description
3
+ Common Cucumber setups to make things go fast and smooth.
4
4
 
5
- ## Installation
5
+ ## Install it
6
6
 
7
- Add this line to your application's Gemfile:
7
+ ``` ruby
8
+ # Gemfile
8
9
 
9
- gem 'cuke-pack'
10
+ gem 'cuke-pack'
11
+ ```
10
12
 
11
- And then execute:
13
+ ``` bash
14
+ bundle exec cuke-pack install
15
+ ```
12
16
 
13
- $ bundle
17
+ This will overwrite your `config/cucumber.yml` file with one that plugs in nicely with Guard. It also adds a new config file in
18
+ `features/support/cuke-pack.rb`.
14
19
 
15
- Or install it yourself as:
20
+ ## Specifying the driver
16
21
 
17
- $ gem install cuke-pack
22
+ If you have other Capybara drivers installed like Poltergeist of persistent_selenium, you can specify the driver as an
23
+ environment variable:
18
24
 
19
- ## Usage
25
+ ``` bash
26
+ DRIVER=poltergeist bundle exec cucumber
27
+ ```
20
28
 
21
- TODO: Write usage instructions here
29
+ ## Confirming JavaScript
22
30
 
23
- ## Contributing
31
+ If you need to confirm an `alert()` or `confirm()`, you can do so in your step with `confirm_js`. Just replaces
32
+ `window.alert` and `window.confirm` with functions that return true.
33
+
34
+ ## Step Writer
35
+
36
+ Enables [cucumber-step_writer](http://github.com/johnbintz/cucumber-step_writer) for you.
37
+
38
+ ## Flay your steps
39
+
40
+ I can get duplicate code in my steps pretty quickly. Sometimes I flay them to see where the duplicates are and then I
41
+ factor out the common code.
42
+
43
+ ## Hijacking `@wip`
44
+
45
+ I personally think the original use of `@wip` in Cucumber is silly. Why would you commit non-working
46
+ features to the source repository? So this project re-purposes `@wip` to let you focus your Cucumber test
47
+ runs on a single feature and work on it until it runs:
48
+
49
+ ### Guard
50
+
51
+ If you're using Guard for continuous testing, install the `wip` guard:
52
+
53
+ ``` bash
54
+ bundle exec cuke-pack wip-guard
55
+ ```
56
+
57
+ You can then use Guard to only run scenarios with the tag `@wip`:
58
+
59
+ ``` bash
60
+ bundle exec guard -g wip
61
+ ```
62
+
63
+ ### Precommit
64
+
65
+ If you run tests before committing your code with a tool like [penchant](http://github.com/johnbintz/penchant),
66
+ you can configure your tests to run using the `precommit` profile. This one ensures that there are no
67
+ `@wip` scenarios. It also lets you skip certain features/scenarios that are tagged `@no-precommit`. Good for
68
+ turning off tests that you haven't needed to touch in a while. Just be careful with it!
69
+
70
+ ## Other things
71
+
72
+ You can easily enable FakeFS, Mocha, and Timecop if you need them. Turn them on in `cuke-pack.rb` and then use
73
+ the right tag on your scenario.
74
+
75
+ ## Old things
76
+
77
+ There's some stuff that is so deprecated that I'll remove it eventually, once all my other offending projects
78
+ don't use them anymore. You shouldn't use them either.
24
79
 
25
- 1. Fork it
26
- 2. Create your feature branch (`git checkout -b my-new-feature`)
27
- 3. Commit your changes (`git commit -am 'Added some feature'`)
28
- 4. Push to the branch (`git push origin my-new-feature`)
29
- 5. Create new Pull Request
@@ -1,4 +1,5 @@
1
1
  def expect_fields(object, *fields, &block)
2
+ $stderr.puts "expect_fields deprecated. Use semantic_rails_view_helpers instead."
2
3
  @__expect_stack ||= 0
3
4
  @__expect_stack += 1
4
5
 
@@ -48,6 +48,8 @@ class WaitingForElementFailure < StandardError
48
48
  end
49
49
 
50
50
  def wait_for(times = MAX_TIMES, &block)
51
+ $stderr.puts "wait_for deprecated. Just use find."
52
+
51
53
  1.upto(times) do
52
54
  ok = false
53
55
 
@@ -68,6 +70,8 @@ def wait_for(times = MAX_TIMES, &block)
68
70
  end
69
71
 
70
72
  def wait_for_not(times = MAX_TIMES, &block)
73
+ $stderr.puts "wait_for_not deprecated. Just use find."
74
+
71
75
  original_time = Capybara.default_wait_time
72
76
  Capybara.default_wait_time = 0
73
77
 
@@ -1,3 +1,3 @@
1
1
  module CukePack
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.2"
3
3
  end
@@ -1,8 +1,12 @@
1
1
  <%
2
- std_opts = "-r features --format #{ENV['CUCUMBER_FORMAT'] || 'pretty'} -f Cucumber::StepWriter --out features/step_definitions --strict"
2
+ std_opts = "--color -r features --format #{ENV['CUCUMBER_FORMAT'] || 'pretty'} -f Cucumber::StepWriter --out features/step_definitions --strict"
3
3
  %>
4
4
  default: <%= std_opts %> features
5
5
  wip: <%= std_opts %> --tags @wip features
6
- precommit: FAILFAST=true <%= std_opts %> --tags ~@wip:0 features
6
+ precommit: <%= std_opts %> --tags ~@wip:0 --tags ~@no-precommit features
7
+
8
+ # or enable FAILFAST to have your tests end immediately on failure
9
+ #precommit: FAILFAST=true <%= std_opts %> --tags ~@wip:0 features
10
+
7
11
  cleanup: <%= std_opts %> -f Cucumber::CleanupFormatter --out unused.txt features
8
12
 
@@ -1,36 +1,28 @@
1
- require 'cuke-pack/support/pause'
2
- require 'cuke-pack/support/pending'
1
+ # use confirm_js in your step to confirm all alert() and confirm() dialogs
3
2
  require 'cuke-pack/support/confirm_js'
4
- require 'cuke-pack/support/expect_fields'
5
-
6
- Before do
7
- # if you want pending steps to pause before marking the step as pending,
8
- # set @pause_ok to true
9
-
10
- @pause_ok = false
11
- end
12
3
 
4
+ # write out missing steps automatically
13
5
  require 'cuke-pack/support/step_writer'
14
- require 'cuke-pack/support/wait_for'
6
+
7
+ # fail instantly if ENV['FAILFAST'] is set
15
8
  require 'cuke-pack/support/failfast'
16
9
 
17
10
  # set the level of flaying on the step definitions
18
11
  # set it to false to skip flaying
19
12
  flay_level = 32
20
-
21
13
  require 'cuke-pack/support/flay'
22
14
 
15
+ # enable fakefs with @fakefs
23
16
  # require 'cuke-pack/support/fakefs'
17
+
18
+ # enable mocha with @mocha
24
19
  # require 'cuke-pack/support/mocha'
25
20
 
26
- # Timecop support
21
+ # Timecop support with @timecop
27
22
  # require 'cuke-pack/support/timecop'
28
23
 
29
24
  # Browser drivers
30
25
  # use with ENV['DRIVER']
26
+ require 'cuke-pack/drivers'
31
27
  # require 'cuke-pack/driver/firefox'
32
- #
33
- # Simple rails controller/view generator
34
- # probably only any good for me
35
- # require 'cuke-pack/support/rails_generator'
36
28
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cuke-pack
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-01-22 00:00:00.000000000 Z
12
+ date: 2013-01-25 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: cucumber