stepdown 1.0.2 → 1.1.0

This diff has not been reviewed by any users.
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 33164129ac3bed55b04982c7468555c3e1058bdb
4
- data.tar.gz: 96504134c823975da8fe0288ab8bdbda19c1dd99
3
+ metadata.gz: f7b2cab3d8d0b49fbc0cf81daaab4f0c0eacc783
4
+ data.tar.gz: 89479c9a025f3c9ded2c3d9c48dccca895b25104
5
5
  SHA512:
6
- metadata.gz: 38194d27e8692fec98f6dd292a4f9e80df54c7645b4a728dde67584f2e3378026ab5b48997cc4840366d62032c0bb3493e4af8252a5202d8a0b03d2a2494e56a
7
- data.tar.gz: aabc5045200206b0c2d8f04aa78de71b8587418288413d90e4330acc26fc716079154fc35ce4bd80d4df954fdf34d4e4e10a1b28caae62c48d99f81c8847df26
6
+ metadata.gz: 74094a762f1c352a68fe130034a9d449f044139c54711f8c0e596debf65c4950fbc06a055c73f81ef76b424fbbce9f37b30ad1c55852f892c3b10294777b8103
7
+ data.tar.gz: d8f7af98440c87c12b50e60caaa81ee766d2bb8d8cf40e17821d3abc7e9c674d28f402a3eabc0e74717da5c4860825caec0ebd2d1dbf1378e48cab5978eb1d46
@@ -1,13 +1,14 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- stepdown (1.0.1)
4
+ stepdown (1.1.0)
5
5
  bundler (~> 1.0)
6
6
  gherkin (~> 2.3)
7
7
 
8
8
  GEM
9
9
  remote: https://rubygems.org/
10
10
  specs:
11
+ bump (0.5.0)
11
12
  coderay (1.1.0)
12
13
  diff-lcs (1.2.5)
13
14
  gherkin (2.12.2)
@@ -34,6 +35,7 @@ PLATFORMS
34
35
  ruby
35
36
 
36
37
  DEPENDENCIES
38
+ bump (~> 0.5)
37
39
  pry (~> 0.10)
38
40
  rake (~> 10.0)
39
41
  rspec (~> 2.5)
data/Rakefile CHANGED
@@ -1,5 +1,6 @@
1
1
  require 'rspec/core/rake_task'
2
2
  require 'bundler/gem_tasks'
3
+ require 'bump/tasks'
3
4
 
4
5
  RSpec::Core::RakeTask.new(:spec) do |t|
5
6
  t.fail_on_error = false
@@ -1,25 +1,13 @@
1
1
  require 'stepdown/step_collection'
2
+ require 'gherkin/i18n'
2
3
 
3
4
  module Stepdown
4
5
  class StepInstance
5
6
  def initialize
6
7
  @steps = []
7
- end
8
-
9
- def Given(regex,&block)
10
- define_step(regex,&block)
11
- end
12
-
13
- def When(regex,&block)
14
- define_step(regex,&block)
15
- end
16
-
17
- def Then(regex,&block)
18
- define_step(regex,&block)
19
- end
20
-
21
- def And(regex,&block)
22
- define_step(regex,&block)
8
+ Gherkin::I18n.code_keywords.each do |code|
9
+ self.class.send(:alias_method, code, :define_step)
10
+ end
23
11
  end
24
12
 
25
13
  def define_step(regex,&block)
@@ -1,3 +1,3 @@
1
1
  module Stepdown
2
- VERSION = "1.0.2"
2
+ VERSION = "1.1.0"
3
3
  end
@@ -63,34 +63,20 @@ describe Stepdown::StepInstance do
63
63
  end
64
64
 
65
65
  end
66
-
66
+
67
67
  describe "parsing step definitions" do
68
68
  before :each do
69
69
  @regex = /reg/
70
70
  end
71
71
 
72
- it "should define given steps" do
73
- @step_instance.Given(@regex)
74
- @step_instance.step_collection.should be_an_instance_of Stepdown::StepCollection
75
- @step_instance.step_collection.count.should == 1
76
- end
77
-
78
- it "should define when steps" do
79
- @step_instance.When(@regex)
80
- @step_instance.step_collection.should be_an_instance_of Stepdown::StepCollection
81
- @step_instance.step_collection.count.should == 1
82
- end
83
-
84
- it "should define then steps" do
85
- @step_instance.Then(@regex)
86
- @step_instance.step_collection.should be_an_instance_of Stepdown::StepCollection
87
- @step_instance.step_collection.count.should == 1
88
- end
72
+ it 'defines methods for all valid code words' do
73
+ Gherkin::I18n.code_keywords.each do |code|
74
+ expect do
75
+ @step_instance.send(code, @regex)
76
+ end.to_not raise_error
77
+ end
89
78
 
90
- it "should define and steps" do
91
- @step_instance.And(@regex)
92
- @step_instance.step_collection.should be_an_instance_of Stepdown::StepCollection
93
- @step_instance.step_collection.count.should == 1
79
+ expect(Gherkin::I18n.code_keywords.count).to eq(@step_instance.step_collection.count)
94
80
  end
95
81
  end
96
82
  end
@@ -22,6 +22,7 @@ Gem::Specification.new do |s|
22
22
  s.add_development_dependency('sass', "~> 3.1")
23
23
  s.add_development_dependency('rake', '~> 10.0')
24
24
  s.add_development_dependency('pry', '~> 0.10')
25
+ s.add_development_dependency('bump', '~> 0.5')
25
26
 
26
27
  s.files = `git ls-files`.split("\n")
27
28
  s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: stepdown
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.2
4
+ version: 1.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sean Caffery
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-09-01 00:00:00.000000000 Z
11
+ date: 2014-09-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: gherkin
@@ -94,6 +94,20 @@ dependencies:
94
94
  - - "~>"
95
95
  - !ruby/object:Gem::Version
96
96
  version: '0.10'
97
+ - !ruby/object:Gem::Dependency
98
+ name: bump
99
+ requirement: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - "~>"
102
+ - !ruby/object:Gem::Version
103
+ version: '0.5'
104
+ type: :development
105
+ prerelease: false
106
+ version_requirements: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - "~>"
109
+ - !ruby/object:Gem::Version
110
+ version: '0.5'
97
111
  description: Stepdown allows you to see where your most used Cucumber steps are, your
98
112
  unused steps and how they are clustered
99
113
  email:
@@ -198,3 +212,4 @@ test_files:
198
212
  - spec/lib/stepdown/step_group_spec.rb
199
213
  - spec/lib/stepdown/step_instance_spec.rb
200
214
  - spec/spec_helper.rb
215
+ has_rdoc: