stepdown 0.3.1 → 0.3.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.rdoc CHANGED
@@ -1,6 +1,5 @@
1
1
  = Step down
2
-
3
- A feature and step file analysis tool.
2
+ Stepdown allows you to see where your most used Cucumber steps are, your unused steps and how they are clustered
4
3
 
5
4
  == Statistics available
6
5
  * Total number of scenarios
data/lib/options.rb CHANGED
@@ -8,22 +8,20 @@ class Options
8
8
  @@steps_dir = "features/step_definitions"
9
9
  @@features_dir = "features"
10
10
  @@reporter = "html"
11
-
12
-
13
11
  parser = OptionParser.new do |opts|
14
12
  opts.banner = "Usage: stepdown step_definition_dir feature_file_directory"
15
13
 
16
14
  opts.separator("")
17
15
 
18
- opts.on("--output TYPE", OUTPUT_FORMATS, "Select ouput format (#{OUTPUT_FORMATS.join(',')})") do |o|
16
+ opts.on("--output=TYPE", OUTPUT_FORMATS, "Select ouput format (#{OUTPUT_FORMATS.join(',')}). Default: html") do |o|
19
17
  @@reporter = o
20
18
  end
21
19
 
22
- opts.on("--steps=directory", "Step definition directory") do |o|
20
+ opts.on("--steps=STEPS_DIR", "Step definition directory. Default: ./features/step_definitions") do |o|
23
21
  @@steps_dir = o
24
22
  end
25
23
 
26
- opts.on("--features=directory", "Feature file directory") do |o|
24
+ opts.on("--features=FEATURE_DIR", "Feature file directory. Default: ./features") do |o|
27
25
  @@features_dir = o
28
26
  end
29
27
 
@@ -37,11 +35,6 @@ class Options
37
35
  begin
38
36
  parser.parse(params)
39
37
 
40
- if parser.getopts.length == 0 && params.length == 2
41
- @@steps_dir = params[0]
42
- @@features_dir = params[1]
43
- end
44
-
45
38
  rescue OptionParser::ParseError => e
46
39
  puts e
47
40
  exit 1
@@ -0,0 +1,74 @@
1
+ require 'rspec'
2
+ require File.expand_path(File.dirname(__FILE__) + '/../../lib/options')
3
+
4
+ describe Options do
5
+
6
+ before :each do
7
+ end
8
+
9
+ describe "setting input directories" do
10
+ it "should allow setting only steps directory" do
11
+ Options.parse(["--steps=step_dir"])
12
+
13
+ Options.steps_dir.should == "step_dir"
14
+ Options.features_dir.should == "features"
15
+
16
+ end
17
+
18
+ it "should allow setting only features directory" do
19
+ Options.parse(["--features=features_dir"])
20
+
21
+ Options.steps_dir.should == "features/step_definitions"
22
+ Options.features_dir.should == "features_dir"
23
+ end
24
+
25
+ it "should allow setting features and settings directory" do
26
+ Options.parse(["--features=features_dir", "--steps=steps_dir"])
27
+
28
+ Options.steps_dir.should == "steps_dir"
29
+ Options.features_dir.should == "features_dir"
30
+ end
31
+ end
32
+
33
+ describe "selecting reporter" do
34
+ it "should select html by default" do
35
+ Options.parse([])
36
+
37
+ Options.reporter.should == "html"
38
+ end
39
+
40
+ it "should allow selecting html" do
41
+ Options.parse(["--output=html"])
42
+
43
+ Options.reporter.should == "html"
44
+ end
45
+
46
+ it "should allow selecting text" do
47
+ Options.parse(["--output=text"])
48
+
49
+ Options.reporter.should == "text"
50
+ end
51
+ end
52
+
53
+ describe "using default directories" do
54
+ it "should select relative step directory" do
55
+ Options.parse([])
56
+
57
+ Options.steps_dir == "features/step_definitions"
58
+ end
59
+
60
+ it "should select relative feature directory" do
61
+ Options.parse([])
62
+
63
+ Options.features_dir.should == "features"
64
+ end
65
+ end
66
+
67
+ describe "validating options" do
68
+ it "should report an invalid steps directory"
69
+ it "should report an invalid features directory"
70
+
71
+ end
72
+
73
+ end
74
+
data/stepdown.gemspec CHANGED
@@ -1,7 +1,7 @@
1
1
 
2
2
  Gem::Specification.new do |s|
3
3
  s.name = "stepdown"
4
- s.version = "0.3.1"
4
+ s.version = "0.3.2"
5
5
  s.platform = Gem::Platform::RUBY
6
6
  s.authors = "Sean Caffery"
7
7
  s.email = "sean@lineonpoint.com"
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: stepdown
3
3
  version: !ruby/object:Gem::Version
4
- hash: 17
4
+ hash: 23
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 3
9
- - 1
10
- version: 0.3.1
9
+ - 2
10
+ version: 0.3.2
11
11
  platform: ruby
12
12
  authors:
13
13
  - Sean Caffery
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-02-27 00:00:00 +11:00
18
+ date: 2011-02-28 00:00:00 +11:00
19
19
  default_executable: stepdown
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency
@@ -79,6 +79,7 @@ files:
79
79
  - lib/text_reporter.rb
80
80
  - public/jquery-1.4.3.min.js
81
81
  - public/step_down.js
82
+ - spec/lib/options_spec.rb
82
83
  - spec/lib/step_group_spec.rb
83
84
  - spec/lib/step_instance_spec.rb
84
85
  - stepdown.gemspec