geordi 1.5.2 → 1.6.0

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.
@@ -7,6 +7,7 @@ Feature: The cucumber command
7
7
  rerun: features
8
8
  """
9
9
 
10
+
10
11
  Scenario: Run a single feature
11
12
  Given a file named "features/single.feature" with:
12
13
  """
@@ -157,3 +158,12 @@ Feature: The cucumber command
157
158
 
158
159
  When I run `geordi cucumber --verbose`
159
160
  Then the output should match /^> PATH=.*24.0:\$PATH.* cucumber/
161
+
162
+
163
+ Scenario: Running all cucumber features matching a given string
164
+ Given a file named "features/given.feature" with "Feature: given"
165
+ And a file named "features/other.feature" with "Feature: other"
166
+
167
+ When I run `geordi cucumber --containing given`
168
+ Then the output should contain "Only: features/given.feature"
169
+ But the output should not contain "other.feature"
@@ -17,6 +17,10 @@ or `-d`.
17
17
  e.g. `--format pretty`.
18
18
  LONGDESC
19
19
 
20
+ option :modified, :aliases => '-m', :type => :boolean,
21
+ :desc => 'Run all modified features'
22
+ option :containing, :aliases => '-c', :banner => 'STRING',
23
+ :desc => 'Run all features that contain STRING'
20
24
  option :verbose, :aliases => '-v', :type => :boolean,
21
25
  :desc => 'Print the testrun command'
22
26
  option :debug, :aliases => '-d', :type => :boolean,
@@ -25,6 +29,22 @@ option :rerun, :aliases => '-r', :type => :numeric, :default => 0,
25
29
  :desc => 'Rerun features up to N times while failing'
26
30
 
27
31
  def cucumber(*args)
32
+ if args.empty?
33
+ # This is not testable as there is no way to stub `git` :(
34
+ if options.modified?
35
+ modified_features = `git status --short`.split($/).map do |line|
36
+ indicators = line.slice!(0..2) # Remove leading indicators
37
+ line if line.include?('.feature') and not indicators.include?('D')
38
+ end.compact
39
+ args = modified_features
40
+ end
41
+
42
+ if options.containing
43
+ matching_features = `grep -lri '#{options.containing}' --include=*.feature features/`.split($/)
44
+ args = matching_features.uniq
45
+ end
46
+ end
47
+
28
48
  if File.directory?('features')
29
49
  require 'geordi/cucumber'
30
50
 
@@ -1,3 +1,3 @@
1
1
  module Geordi
2
- VERSION = '1.5.2'
2
+ VERSION = '1.6.0'
3
3
  end
metadata CHANGED
@@ -1,27 +1,30 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: geordi
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.5.2
4
+ version: 1.6.0
5
+ prerelease:
5
6
  platform: ruby
6
7
  authors:
7
8
  - Henning Koch
8
9
  autorequire:
9
10
  bindir: bin
10
11
  cert_chain: []
11
- date: 2016-09-23 00:00:00.000000000 Z
12
+ date: 2016-12-01 00:00:00.000000000 Z
12
13
  dependencies:
13
14
  - !ruby/object:Gem::Dependency
14
15
  name: thor
15
16
  requirement: !ruby/object:Gem::Requirement
17
+ none: false
16
18
  requirements:
17
- - - ">="
19
+ - - ! '>='
18
20
  - !ruby/object:Gem::Version
19
21
  version: 0.18.0
20
22
  type: :runtime
21
23
  prerelease: false
22
24
  version_requirements: !ruby/object:Gem::Requirement
25
+ none: false
23
26
  requirements:
24
- - - ">="
27
+ - - ! '>='
25
28
  - !ruby/object:Gem::Version
26
29
  version: 0.18.0
27
30
  description: Collection of command line tools we use in our daily work with Ruby,
@@ -50,8 +53,8 @@ executables:
50
53
  extensions: []
51
54
  extra_rdoc_files: []
52
55
  files:
53
- - ".gitignore"
54
- - ".ruby-version"
56
+ - .gitignore
57
+ - .ruby-version
55
58
  - Gemfile
56
59
  - Gemfile.lock
57
60
  - LICENSE
@@ -129,26 +132,29 @@ files:
129
132
  homepage: http://makandra.com
130
133
  licenses:
131
134
  - MIT
132
- metadata: {}
133
- post_install_message: "* Binary `geordi` installed\n"
135
+ post_install_message: ! '* Binary `geordi` installed
136
+
137
+ '
134
138
  rdoc_options: []
135
139
  require_paths:
136
140
  - lib
137
141
  required_ruby_version: !ruby/object:Gem::Requirement
142
+ none: false
138
143
  requirements:
139
- - - ">="
144
+ - - ! '>='
140
145
  - !ruby/object:Gem::Version
141
146
  version: '0'
142
147
  required_rubygems_version: !ruby/object:Gem::Requirement
148
+ none: false
143
149
  requirements:
144
- - - ">="
150
+ - - ! '>='
145
151
  - !ruby/object:Gem::Version
146
152
  version: '0'
147
153
  requirements: []
148
154
  rubyforge_project: geordi
149
- rubygems_version: 2.5.1
155
+ rubygems_version: 1.8.23.2
150
156
  signing_key:
151
- specification_version: 4
157
+ specification_version: 3
152
158
  summary: Collection of command line tools we use in our daily work with Ruby, Rails
153
159
  and Linux at makandra.
154
160
  test_files: []
checksums.yaml DELETED
@@ -1,7 +0,0 @@
1
- ---
2
- SHA1:
3
- metadata.gz: 0d9d613b214f8cc711edd164cf848d2832792237
4
- data.tar.gz: e91eb49d7df4be3826ca53d86c44a53aefb5a48e
5
- SHA512:
6
- metadata.gz: 90d6d24374ac2bc356042f3587fe384f8a558725cebaae0d5c03c248cf1e9957bf8a442715abbbcdff76e4768ec2af66f47e59aeea5027b5595d4fd2c0841c69
7
- data.tar.gz: d206eb552fde74c2cb2b66a01edcc2b14b8ca9a3ed4e878f05631e57222e29f7b505b398851f0ff56702a485d89ffd2660ad4c998791b243e07309b774df9b8a