cucumber-timed_formatter 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
data/.rvmrc ADDED
@@ -0,0 +1 @@
1
+ rvm use 1.8.7-p352@cucumber-timed_formatter --create
data/Gemfile ADDED
@@ -0,0 +1,7 @@
1
+ source :rubygems
2
+
3
+ gemspec
4
+
5
+ group :development do
6
+ gem 'gem-release'
7
+ end
data/README ADDED
@@ -0,0 +1,18 @@
1
+ = Timed Progress Formatter
2
+
3
+ In order to get a quick overview over the scenarios and running times
4
+ As a developer and CI-user
5
+ I want to have a timed cucumber formatter
6
+
7
+ == Installation/Usage
8
+
9
+ If you're using Rails, simply drop it in your features/support directory.
10
+
11
+ Then, you can say:
12
+
13
+ cucumber features/* -f Cucumber::Formatter::Timed
14
+
15
+ Not using Rails? You just need to ensure that the file is somewhere it can be
16
+ included, and call it like:
17
+
18
+ cucumber features/* --require path/to/timed.rb -f Cucumber::Formatter::Timed
@@ -0,0 +1,30 @@
1
+ # vim:ft=ruby:fileencoding=utf-8
2
+
3
+ require File.expand_path('../lib/cucumber-timed_formatter/version.rb', __FILE__)
4
+
5
+ spec = Gem::Specification.new do |s|
6
+ s.name = "cucumber-timed_formatter"
7
+ s.version = Cucumber::Formatter::Timed::VERSION
8
+ s.date = File.mtime(__FILE__)
9
+ s.summary = "A progress-formatter with a little more info"
10
+ s.description = "A progress-formatter with a little more info: Each Scenario is one line and the time is measured."
11
+
12
+ s.authors = ["Matthias Viehweger"]
13
+ s.email = 'kronn@kronn.de'
14
+ s.homepage = 'http://github.com/kronn/cucumber-timed_formatter'
15
+ s.rubyforge_project = '[none]' # to supress the warning
16
+
17
+ s.require_paths = ["lib"]
18
+ s.files = `git ls-files`.split("\n") - ['.gitignore']
19
+ # s.test_files = `git ls-files test`.split("\n")
20
+
21
+ s.rdoc_options = ['--charset=utf-8', '--fmt=shtml', '--all']
22
+ # s.extra_rdoc_files = []
23
+
24
+ s.add_dependency 'cucumber', '>= 0.4'
25
+
26
+ # for release and doc generation, more less optional
27
+ # s.add_development_dependency 'rake'
28
+ # s.add_development_dependency 'rdoc', '>= 2.4.2'
29
+ # s.add_development_dependency 'sdoc'
30
+ end
@@ -0,0 +1,7 @@
1
+ module Cucumber
2
+ module Formatter
3
+ class Timed
4
+ VERSION = '0.1.0'
5
+ end
6
+ end
7
+ end
@@ -0,0 +1,45 @@
1
+ require 'cucumber/formatter/progress'
2
+
3
+ module Cucumber
4
+ module Formatter
5
+ class Timed < Progress
6
+ def initialize(step_mother, io, options)
7
+ @io = io
8
+ @duration = 0.0
9
+ super
10
+ end
11
+
12
+ def before_feature(feature)
13
+ @io.puts "#{feature.name.lines.first.chomp} [#{feature.file}]"
14
+ end
15
+
16
+ def before_steps(steps)
17
+ @my_time = Time.now
18
+ end
19
+
20
+ def after_steps(steps)
21
+ @duration += Time.now - @my_time
22
+ end
23
+
24
+ def after_step_result(keyword, step_match, multiline_arg, status, exception, source_indent, background)
25
+ super
26
+ if status == :failed
27
+ error_msg = "#{exception.message} (#{exception.class.name})\n#{exception.backtrace.join("\n")}"
28
+
29
+ @io.puts <<-EOMESSAGE
30
+
31
+ #{format_string(step_match.backtrace_line, :comment)}
32
+
33
+ #{format_string(error_msg, status)}
34
+
35
+ EOMESSAGE
36
+ end
37
+ end
38
+
39
+ def after_feature_element(scenario)
40
+ @io.puts " #{scenario.name} (#{@duration}s)"
41
+ @duration = 0.0
42
+ end
43
+ end
44
+ end
45
+ end
metadata ADDED
@@ -0,0 +1,86 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: cucumber-timed_formatter
3
+ version: !ruby/object:Gem::Version
4
+ hash: 27
5
+ prerelease:
6
+ segments:
7
+ - 0
8
+ - 1
9
+ - 0
10
+ version: 0.1.0
11
+ platform: ruby
12
+ authors:
13
+ - Matthias Viehweger
14
+ autorequire:
15
+ bindir: bin
16
+ cert_chain: []
17
+
18
+ date: 2012-03-14 00:00:00 Z
19
+ dependencies:
20
+ - !ruby/object:Gem::Dependency
21
+ name: cucumber
22
+ prerelease: false
23
+ requirement: &id001 !ruby/object:Gem::Requirement
24
+ none: false
25
+ requirements:
26
+ - - ">="
27
+ - !ruby/object:Gem::Version
28
+ hash: 3
29
+ segments:
30
+ - 0
31
+ - 4
32
+ version: "0.4"
33
+ type: :runtime
34
+ version_requirements: *id001
35
+ description: "A progress-formatter with a little more info: Each Scenario is one line and the time is measured."
36
+ email: kronn@kronn.de
37
+ executables: []
38
+
39
+ extensions: []
40
+
41
+ extra_rdoc_files: []
42
+
43
+ files:
44
+ - .rvmrc
45
+ - Gemfile
46
+ - README
47
+ - cucumber-timed_formatter.gemspec
48
+ - lib/cucumber-timed_formatter/version.rb
49
+ - lib/timed.rb
50
+ homepage: http://github.com/kronn/cucumber-timed_formatter
51
+ licenses: []
52
+
53
+ post_install_message:
54
+ rdoc_options:
55
+ - --charset=utf-8
56
+ - --fmt=shtml
57
+ - --all
58
+ require_paths:
59
+ - lib
60
+ required_ruby_version: !ruby/object:Gem::Requirement
61
+ none: false
62
+ requirements:
63
+ - - ">="
64
+ - !ruby/object:Gem::Version
65
+ hash: 3
66
+ segments:
67
+ - 0
68
+ version: "0"
69
+ required_rubygems_version: !ruby/object:Gem::Requirement
70
+ none: false
71
+ requirements:
72
+ - - ">="
73
+ - !ruby/object:Gem::Version
74
+ hash: 3
75
+ segments:
76
+ - 0
77
+ version: "0"
78
+ requirements: []
79
+
80
+ rubyforge_project: "[none]"
81
+ rubygems_version: 1.8.18
82
+ signing_key:
83
+ specification_version: 3
84
+ summary: A progress-formatter with a little more info
85
+ test_files: []
86
+