crab 0.1.1 → 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -15,13 +15,14 @@ stay out of the way as much as possible.
15
15
  Installing
16
16
  ----------
17
17
 
18
- `crab` is distributed as a Ruby Gem. To install it, simply issue:
18
+ `crab` is distributed as a Ruby Gem. To install it, simply issue (where
19
+ `$` is your command prompt):
19
20
 
20
- gem install crab
21
+ $ gem install crab
21
22
 
22
- And you should be good to go. To make sure everything is ok, try:
23
+ And you should be good to go. To make sure everything is OK, try:
23
24
 
24
- crab -h
25
+ $ crab -h
25
26
 
26
27
  If you see a help message, everything went fine.
27
28
 
@@ -36,25 +37,25 @@ writing them straight in Cucumber features would be better suited.
36
37
  Initially, there were concerns around migration of the existing data.
37
38
  Thankfully, that part is easy:
38
39
 
39
- # crab login -u cv@lixo.org -p mypassword
40
+ $ crab login -u cv@lixo.org -p secr3t
40
41
  Logged in as cv@lixo.org.
41
42
 
42
- # crab project "World Domination 3000"
43
- # crab list
43
+ $ crab project "World Domination 3000"
44
+ $ crab list
44
45
  US1001: Arms Rockets Upon Successful Boot
45
46
  US1002: Launches Rockets Upon Command from Evil Mastermind
46
- US1003: Transfer $0.01 From All Bank Accounts
47
+ US1003: Transfers $0.01 From All Bank Accounts
47
48
  ...
48
49
 
49
- # crab find Rockets
50
- US1001: Arms Rockets Upon Successful Boot
50
+ $ crab find Rockets
51
+ US1001: Arms Rockets After Boot
51
52
  US1002: Launches Rockets Upon Command from Evil Mastermind
52
53
 
53
- # crab show US1001
54
+ $ crab show US1001
54
55
  Feature: [US1001] Arms Rockets After Boot
55
56
 
56
57
  In order to gain bargaining power with Super Hero
57
- As an Evil Mastermind
58
+ An Evil Mastermind
58
59
  Wants visible evidence that the rockets have been armed
59
60
 
60
61
  ...
@@ -62,7 +63,7 @@ Thankfully, that part is easy:
62
63
  If there are any test cases, their steps get converted into Cucumber
63
64
  steps:
64
65
 
65
- # crab show US1001
66
+ $ crab show US1001
66
67
  ...
67
68
 
68
69
  Scenario: [TC10001] Rocket Silo Is Unlocked
@@ -73,17 +74,37 @@ steps:
73
74
  ...
74
75
 
75
76
  Some data about stories can also be edited straight from the command line.
76
- In that sense, `crab` acts more like a CLI interface to Rally than a bridge
77
+ In that sense, `crab` acts more like a command-line interface to Rally than a bridge
77
78
  between Rally and Cucumber, but the team thought these were *very* convenient
78
79
  features to have:
79
80
 
80
- # crab update US1001 --name "Arms Rockets Upon Successful Boot" --state completed
81
+ $ crab update US1001 --name "Arms Rockets Upon Successful Boot" --state completed
81
82
 
82
83
  There are more switches. Check out `crab update --help` to find out more.
83
84
 
85
+ Developing
86
+ ----------
87
+
88
+ To develop `crab`, you are going to need [`bundler`][3], [Aruba][4] and a
89
+ working Rally account with a project set up where you can edit things. The
90
+ supplied `Gemfile` should take care of everything else:
91
+
92
+ $ git clone git@github.com:cv/crab.git
93
+ $ cd crab
94
+ $ bundle install
95
+ $ rake
96
+
97
+ If you have any problems, please let us know.
98
+
99
+ [3]: http://gembundler.com
100
+ [4]: http://github.com/cucumber/aruba
101
+
84
102
  To do
85
103
  -----
86
104
 
105
+ - Add a config command + .crab/config file to hold settings like project, etc
106
+ - Remove account-specific Rally tests
107
+ - Ability to create and delete stories with all mandatory fields from the command line
87
108
  - Add a `push` subcommand which parses a Cucumber feature and adds or updates it in Rally
88
109
  - Add a way to create, edit and delete test cases / scenarios from the command line
89
110
  - `pull` is not very smart and could detect feature files being moved from one dir to another
@@ -92,15 +113,23 @@ To do
92
113
  - Verbose logging (especially before any change or destructive operations in Rally)
93
114
  - Dry-run mode
94
115
  - Figure out how to stub or simulate Rally (tests are taking way too long already)
116
+ - Error messages are still more cryptic than we'd like
117
+ - Add a `move` subcommand which moves the story from one state to the next (potentially, `move --back`)
118
+ - Add a Cucumber Formatter that updates Test Runs in Rally with results from CI
119
+ - Add `@manual` tags to Test Cases marked as such
120
+ - Investigate use of other fields like Priority and Risk in Rally Test Cases
121
+ - Support i18n Cucumber Features
122
+ - Make it possible to associate defects with Features (essentially treating defects like stories)
123
+ - Test in Ruby 1.9
95
124
 
96
125
  Suggestions? Please get in touch!
97
126
 
98
127
  Authors and Contributors
99
128
  ------------------------
100
129
 
101
- Carlos Villela <cvillela@thoughtworks.com>
102
- Rodrigo Kochenburger <rkochen@thoughtworks.com>
103
- Fabio Rehm <frehm@thoughtworks.com>
130
+ - Carlos Villela <cvillela@thoughtworks.com>
131
+ - Rodrigo Kochenburger <rkochen@thoughtworks.com>
132
+ - Fabio Rehm <frehm@thoughtworks.com>
104
133
 
105
134
  And last but not least, Rodrigo Spohr <rspohr@thoughtworks.com> for the user testing.
106
135
 
@@ -109,6 +138,7 @@ Disclaimers
109
138
 
110
139
  This project and its authors have no affiliation with Rally Software Development Corp. or the Cucumber project.
111
140
 
141
+
112
142
  It was written as necessity in a real-world project, and by no means should represent endorsement of either product.
113
143
 
114
144
  Rally (c) 2003-2011 Rally Software Development Corp.
@@ -131,5 +161,3 @@ distributed under the License is distributed on an "AS IS" BASIS,
131
161
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
132
162
  or implied. See the License for the specific language governing
133
163
  permissions and limitations under the License.
134
-
135
-
data/crab.gemspec CHANGED
@@ -7,7 +7,7 @@ Gem::Specification.new do |s|
7
7
  s.version = Crab::VERSION
8
8
  s.authors = ["Carlos Villela"]
9
9
  s.email = ["cvillela@thoughtworks.com"]
10
- s.homepage = ""
10
+ s.homepage = "http://github.com/cv/crab"
11
11
  s.summary = %q{Cucumber-Rally Bridge}
12
12
  s.description = %q{CRaB is a bridge between Cucumber and Rally}
13
13
 
@@ -18,11 +18,8 @@ Gem::Specification.new do |s|
18
18
  s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
19
19
  s.require_paths = ["lib"]
20
20
 
21
- s.executables = 'crab'
22
-
23
21
  s.add_development_dependency 'aruba'
24
22
 
25
- s.add_dependency 'aruba'
26
23
  s.add_dependency 'cucumber'
27
24
  s.add_dependency 'rally_rest_api'
28
25
  s.add_dependency 'highline'
@@ -11,11 +11,12 @@ Feature: Subcommand Help
11
11
 
12
12
  Scenario: Help
13
13
  When I run `crab -h`
14
- Then the output should contain " login Persistently authenticate user with Rally"
15
- And the output should contain " list Lists stories"
16
- And the output should contain " update Update a story (name, estimate, etc)"
17
- And the output should contain " show Show a story (and its test cases) as a Cucumber feature"
14
+ Then the output should contain " find Find stories by text in name, description or notes"
15
+ And the output should contain " login Persistently authenticate user with Rally"
16
+ And the output should contain " project Persistently select project to work with in Rally"
18
17
  And the output should contain " pull Downloads stories (and its test cases) as Cucumber feature files"
18
+ And the output should contain " show Show a story (and its test cases) as a Cucumber feature"
19
+ And the output should contain " update Update a story (name, estimate, etc)"
19
20
 
20
21
  Scenario: Bogus Subcommand
21
22
  When I run `crab bogus`
@@ -42,15 +43,6 @@ crab show: displays a story in Rally as a Cucumber feature
42
43
  Usage: crab [options] show story
43
44
  """
44
45
 
45
- Scenario: List Subcommand
46
- When I run `crab list --help`
47
- Then the output should contain:
48
- """
49
- crab list: lists stories in Rally
50
-
51
- Usage: crab [options] list
52
- """
53
-
54
46
  Scenario: Update Subcommand
55
47
  When I run `crab update --help`
56
48
  Then the output should contain:
@@ -74,11 +66,5 @@ Usage: crab [options] update story [options]
74
66
  """
75
67
  crab find: find a story in Rally
76
68
 
77
- Usage: crab [options] find [options] text
69
+ Usage: crab [options] find [options] [text]
78
70
  """
79
-
80
- Scenario: Find Needs Text
81
- When I run `crab find`
82
- Then the output should contain "Error: No search pattern given."
83
-
84
-
@@ -8,7 +8,3 @@ end
8
8
  Before '~@quick' do
9
9
  @aruba_io_wait_seconds = 5
10
10
  end
11
-
12
- Before '@really-slow' do
13
- @aruba_io_wait_seconds = 30
14
- end
data/lib/crab.rb CHANGED
@@ -6,7 +6,6 @@ require "crab/story"
6
6
  require "crab/cli"
7
7
  require "crab/pull"
8
8
  require "crab/login"
9
- require "crab/list"
10
9
  require "crab/find"
11
10
  require "crab/update"
12
11
  require "crab/show"
data/lib/crab/cli.rb CHANGED
@@ -11,13 +11,12 @@ module Crab
11
11
  banner """
12
12
  crab version #{Crab::VERSION}: A Cucumber-Rally bridge
13
13
 
14
+ find Find stories by text in name, description or notes
14
15
  login Persistently authenticate user with Rally
15
16
  project Persistently select project to work with in Rally
16
- list Lists stories
17
- update Update a story (name, estimate, etc)
18
- show Show a story (and its test cases) as a Cucumber feature
19
17
  pull Downloads stories (and its test cases) as Cucumber feature files
20
- find Find stories by text in name, description or notes
18
+ show Show a story (and its test cases) as a Cucumber feature
19
+ update Update a story (name, estimate, etc)
21
20
  """
22
21
  stop_on SUB_COMMANDS
23
22
  end
@@ -53,17 +52,6 @@ Usage: crab [options] login"
53
52
 
54
53
  Crab::Login.new(global_opts, cmd_opts).run
55
54
 
56
- when "list"
57
- cmd_opts = Trollop::options do
58
- banner "crab list: lists stories in Rally
59
-
60
- Usage: crab [options] list"
61
- opt :pagesize, "Number of items to fetch per page", :short => "-s", :default => 100
62
- opt :project, "Project to use (required unless set by 'crab project')", :short => "-p", :type => String
63
- end
64
-
65
- Crab::List.new(global_opts, cmd_opts).run
66
-
67
55
  when "update"
68
56
  cmd_opts = Trollop::options do
69
57
  banner "crab update: update a story in Rally
@@ -85,7 +73,7 @@ Usage: crab [options] update story [options]"
85
73
  cmd_opts = Trollop::options do
86
74
  banner "crab find: find a story in Rally
87
75
 
88
- Usage: crab [options] find [options] text"
76
+ Usage: crab [options] find [options] [text]"
89
77
  opt :project, "Project to use (required unless set by 'crab project')", :short => "-p", :type => String
90
78
  end
91
79
 
data/lib/crab/find.rb CHANGED
@@ -12,8 +12,6 @@ module Crab
12
12
 
13
13
  def run
14
14
  pattern = @args.map(&:strip).reject(&:empty?)
15
- Trollop::die "No search pattern given" if pattern.empty?
16
-
17
15
  project_name = valid_project_name(@cmd_opts)
18
16
 
19
17
  @rally.connect
@@ -22,7 +20,7 @@ module Crab
22
20
 
23
21
  Trollop::die "Project #{@cmd_opts[:project].inspect} not found" if project.nil?
24
22
 
25
- @rally.find_story(project, pattern).each do |story|
23
+ @rally.find_stories(project, pattern).each do |story|
26
24
  puts "#{story.formatted_id}: #{story.name} (#{story.state})"
27
25
  end
28
26
  end
data/lib/crab/rally.rb CHANGED
@@ -22,7 +22,9 @@ module Crab
22
22
  @rally.find_all(:hierarchical_requirement, {:fetch => true}.merge(opts)).map {|s| Crab::Story.new s }
23
23
  end
24
24
 
25
- def find_story(project, pattern)
25
+ def find_stories(project, pattern=[])
26
+ return find_all_stories :project => project if pattern.empty?
27
+
26
28
  @rally.find(:hierarchical_requirement, :fetch => true, :project => project) {
27
29
  pattern.each do |word|
28
30
  _or_ {
data/lib/crab/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Crab
2
- VERSION = "0.1.1"
2
+ VERSION = "0.1.2"
3
3
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: crab
3
3
  version: !ruby/object:Gem::Version
4
- hash: 25
4
+ hash: 31
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 1
9
- - 1
10
- version: 0.1.1
9
+ - 2
10
+ version: 0.1.2
11
11
  platform: ruby
12
12
  authors:
13
13
  - Carlos Villela
@@ -33,7 +33,7 @@ dependencies:
33
33
  type: :development
34
34
  version_requirements: *id001
35
35
  - !ruby/object:Gem::Dependency
36
- name: aruba
36
+ name: cucumber
37
37
  prerelease: false
38
38
  requirement: &id002 !ruby/object:Gem::Requirement
39
39
  none: false
@@ -47,7 +47,7 @@ dependencies:
47
47
  type: :runtime
48
48
  version_requirements: *id002
49
49
  - !ruby/object:Gem::Dependency
50
- name: cucumber
50
+ name: rally_rest_api
51
51
  prerelease: false
52
52
  requirement: &id003 !ruby/object:Gem::Requirement
53
53
  none: false
@@ -61,7 +61,7 @@ dependencies:
61
61
  type: :runtime
62
62
  version_requirements: *id003
63
63
  - !ruby/object:Gem::Dependency
64
- name: rally_rest_api
64
+ name: highline
65
65
  prerelease: false
66
66
  requirement: &id004 !ruby/object:Gem::Requirement
67
67
  none: false
@@ -75,7 +75,7 @@ dependencies:
75
75
  type: :runtime
76
76
  version_requirements: *id004
77
77
  - !ruby/object:Gem::Dependency
78
- name: highline
78
+ name: activesupport
79
79
  prerelease: false
80
80
  requirement: &id005 !ruby/object:Gem::Requirement
81
81
  none: false
@@ -89,7 +89,7 @@ dependencies:
89
89
  type: :runtime
90
90
  version_requirements: *id005
91
91
  - !ruby/object:Gem::Dependency
92
- name: activesupport
92
+ name: i18n
93
93
  prerelease: false
94
94
  requirement: &id006 !ruby/object:Gem::Requirement
95
95
  none: false
@@ -103,7 +103,7 @@ dependencies:
103
103
  type: :runtime
104
104
  version_requirements: *id006
105
105
  - !ruby/object:Gem::Dependency
106
- name: i18n
106
+ name: sanitize
107
107
  prerelease: false
108
108
  requirement: &id007 !ruby/object:Gem::Requirement
109
109
  none: false
@@ -117,7 +117,7 @@ dependencies:
117
117
  type: :runtime
118
118
  version_requirements: *id007
119
119
  - !ruby/object:Gem::Dependency
120
- name: sanitize
120
+ name: trollop
121
121
  prerelease: false
122
122
  requirement: &id008 !ruby/object:Gem::Requirement
123
123
  none: false
@@ -130,20 +130,6 @@ dependencies:
130
130
  version: "0"
131
131
  type: :runtime
132
132
  version_requirements: *id008
133
- - !ruby/object:Gem::Dependency
134
- name: trollop
135
- prerelease: false
136
- requirement: &id009 !ruby/object:Gem::Requirement
137
- none: false
138
- requirements:
139
- - - ">="
140
- - !ruby/object:Gem::Version
141
- hash: 3
142
- segments:
143
- - 0
144
- version: "0"
145
- type: :runtime
146
- version_requirements: *id009
147
133
  description: CRaB is a bridge between Cucumber and Rally
148
134
  email:
149
135
  - cvillela@thoughtworks.com
@@ -162,7 +148,6 @@ files:
162
148
  - bin/crab
163
149
  - crab.gemspec
164
150
  - features/find-text-in-stories.feature
165
- - features/list-from-rally.feature
166
151
  - features/login-and-out-of-rally.feature
167
152
  - features/project-selection.feature
168
153
  - features/pull-from-rally-into-cucumber.feature
@@ -176,7 +161,6 @@ files:
176
161
  - lib/crab/cucumber_feature.rb
177
162
  - lib/crab/cucumber_scenario.rb
178
163
  - lib/crab/find.rb
179
- - lib/crab/list.rb
180
164
  - lib/crab/login.rb
181
165
  - lib/crab/project.rb
182
166
  - lib/crab/pull.rb
@@ -194,7 +178,7 @@ files:
194
178
  - old/templates/feature-pt.mustache
195
179
  - old/templates/feature.mustache
196
180
  has_rdoc: true
197
- homepage: ""
181
+ homepage: http://github.com/cv/crab
198
182
  licenses: []
199
183
 
200
184
  post_install_message:
@@ -1,27 +0,0 @@
1
- Feature: List Stories in Rally
2
-
3
- In order to figure out which stories she needs to pull
4
- A developer who doesn't want to open a browser or click on things
5
- Wants to list stories in Rally
6
-
7
- Background:
8
- Given I am logged in
9
- And I have selected the project "VEJA SP - Migração para o Alexandria"
10
-
11
- @really-slow
12
- Scenario: Basic Invocation
13
- When I run `crab list`
14
- Then the output should contain "US4988: Sample Crab Story (grooming)"
15
-
16
- @quick
17
- Scenario: Project Must be Specified When Not Selected
18
- Given no project is selected
19
- When I run `crab list`
20
- Then the output should contain "Error: argument --project must be specified."
21
-
22
- Scenario: Project Must Exist
23
- When I run `crab list -p "foo"`
24
- Then the output should contain:
25
- """
26
- Error: Project "foo" not found.
27
- """
data/lib/crab/list.rb DELETED
@@ -1,29 +0,0 @@
1
- module Crab
2
- class List
3
-
4
- include Utilities
5
-
6
- def initialize(global_opts, cmd_opts)
7
- @global_opts = global_opts
8
- @cmd_opts = cmd_opts
9
- @rally = Rally.new
10
- end
11
-
12
- def run
13
- @rally.connect
14
-
15
- project_name = valid_project_name(@cmd_opts)
16
-
17
- opts = {
18
- :pagesize => @cmd_opts[:pagesize],
19
- :project => @rally.find_project(project_name),
20
- }
21
-
22
- Trollop::die "Project #{@cmd_opts[:project].inspect} not found" if opts[:project].nil?
23
-
24
- @rally.find_all_stories(opts).each do |story|
25
- puts "#{story.formatted_id}: #{story.name} (#{story.state})"
26
- end
27
- end
28
- end
29
- end