Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
155 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,3 @@ | ||
examples/self_test/* | ||
*.gem | ||
pkg/* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
cucumber-json | ||
============= | ||
|
||
A [Cucumber Output Formatter](http://wiki.github.com/aslakhellesoy/cucumber/custom-formatters) | ||
that generates JSON. | ||
|
||
Feature: JSON formatter | ||
As a developer | ||
I want to receive reports of failing cucumber features in a parsable format | ||
In order to facilitace elegant continuous integration | ||
In order to protect revenue | ||
|
||
Installation | ||
------------ | ||
|
||
gem install cucumber-json | ||
|
||
Usage | ||
----- | ||
|
||
In your project: | ||
|
||
cucumber --format Cucumber::Formatter::JSON | ||
|
||
Or, to output to a file: | ||
|
||
cucumber --format Cucumber::Formatter::JSON --out path/to/filename | ||
|
||
Parsing | ||
------- | ||
|
||
The JSON generated is a hash that has 3 keys: | ||
|
||
* failing_features | ||
* an array of all failing features, in a format similar to the default | ||
cucumber format | ||
* features | ||
* an array of all features, in a format similar to the default cucumber | ||
format | ||
* status_counts | ||
* a hash of statuses, and the number of steps with that status | ||
|
||
Additional information could be added to this hash in the future; this is just | ||
what I needed at the moment. | ||
|
||
Example | ||
------- | ||
|
||
The output of this project's cucumber features have been run through the | ||
`Cucumber::Formatter::JSON` formatter and included at `examples/features.json`. | ||
This was generated like so: | ||
|
||
cucumber -f Cucumber::Formatter::JSON --out examples/features.json | ||
|
||
Author | ||
------ | ||
|
||
[Jesse Newland](http://twitter.com/jnewland) | ||
|
||
License | ||
------- | ||
|
||
MIT, same license as Ruby. See `LICENSE` for more details |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
# Generated by jeweler | ||
# DO NOT EDIT THIS FILE DIRECTLY | ||
# Instead, edit Jeweler::Tasks in Rakefile, and run the gemspec command | ||
# -*- encoding: utf-8 -*- | ||
|
||
Gem::Specification.new do |s| | ||
s.name = %q{cucumber-json} | ||
s.version = "0.0.1" | ||
|
||
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version= | ||
s.authors = ["Jesse Newland"] | ||
s.date = %q{2010-05-19} | ||
s.description = %q{A cucumber formatter that outputs JSON} | ||
s.email = %q{jnewland@gmail.com} | ||
s.extra_rdoc_files = [ | ||
"LICENSE" | ||
] | ||
s.files = [ | ||
".gitignore", | ||
"LICENSE", | ||
"Rakefile", | ||
"Readme.md", | ||
"cucumber-json.gemspec", | ||
"examples/features.json", | ||
"features/formatter.feature", | ||
"features/step_definitions/cucumber_steps.rb", | ||
"features/step_definitions/custom_steps.rb", | ||
"features/support/env.rb", | ||
"lib/cucumber/formatter/json.rb", | ||
"lib/cucumber/formatter/json/version.rb" | ||
] | ||
s.homepage = %q{http://github.com/jnewland/cucumber-json} | ||
s.rdoc_options = ["--charset=UTF-8"] | ||
s.require_paths = ["lib"] | ||
s.rubygems_version = %q{1.3.6} | ||
s.summary = %q{A cucumber formatter that outputs JSON} | ||
s.test_files = [ | ||
"features/formatter.feature", | ||
"features/step_definitions", | ||
"features/step_definitions/cucumber_steps.rb", | ||
"features/step_definitions/custom_steps.rb", | ||
"features/support", | ||
"features/support/env.rb" | ||
] | ||
|
||
if s.respond_to? :specification_version then | ||
current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION | ||
s.specification_version = 3 | ||
|
||
if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then | ||
s.add_runtime_dependency(%q<cucumber>, ["~> 0.6.3"]) | ||
s.add_runtime_dependency(%q<json>, ["~> 1.2.1"]) | ||
else | ||
s.add_dependency(%q<cucumber>, ["~> 0.6.3"]) | ||
s.add_dependency(%q<json>, ["~> 1.2.1"]) | ||
end | ||
else | ||
s.add_dependency(%q<cucumber>, ["~> 0.6.3"]) | ||
s.add_dependency(%q<json>, ["~> 1.2.1"]) | ||
end | ||
end | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{"failing_features":[],"features":[" Scenario:: One Failing Feature\n When I run cucumber -r ../../../lib -r features/step_definitions -f Cucumber::Formatter::JSON features/one_failure.feature\n Then the output should contain \"output['status_counts']['failed']\" set to \"1\"\n And the output should contain \"output['status_counts']['passed']\" set to \"1\"\n And the output should contain \"output['status_counts']['undefined']\" set to \"1\"\n And the output should contain \"output['status_counts']['pending']\" set to \"1\"\n And the output should contain the failing feature\n \"\"\"\n Scenario:: Failing\n Given failing # features/step_definitions/steps.rb:1\n FAIL (RuntimeError)\n ./features/step_definitions/steps.rb:2:in `/failing/'\n features/one_failure.feature:4:in `Given failing'\n\n \"\"\"\n"," Scenario:: Multiple Failing Features\n When I run cucumber -r ../../../lib -r features/step_definitions -f Cucumber::Formatter::JSON features/multiple_failures.feature\n Then the output should contain \"output['status_counts']['failed']\" set to \"3\"\n And the output should contain \"output['status_counts']['passed']\" set to \"1\"\n And the output should contain the failing feature\n \"\"\"\n Scenario:: Failing\n Given failing # features/step_definitions/steps.rb:1\n FAIL (RuntimeError)\n ./features/step_definitions/steps.rb:2:in `/failing/'\n features/multiple_failures.feature:4:in `Given failing'\n\n \"\"\"\n And the output should contain the failing feature\n \"\"\"\n Scenario:: Failing2\n Given failing # features/step_definitions/steps.rb:1\n FAIL (RuntimeError)\n ./features/step_definitions/steps.rb:2:in `/failing/'\n features/multiple_failures.feature:7:in `Given failing'\n\n \"\"\"\n And the output should contain the failing feature\n \"\"\"\n Scenario:: Failing3\n Given failing # features/step_definitions/steps.rb:1\n FAIL (RuntimeError)\n ./features/step_definitions/steps.rb:2:in `/failing/'\n features/multiple_failures.feature:10:in `Given failing'\n\n \"\"\"\n"," Scenario:: All Features Passing\n When I run cucumber -r ../../../lib -r features/step_definitions -f Cucumber::Formatter::JSON features/all_passing.feature\n Then the output should contain \"output['status_counts']['passed']\" set to \"2\"\n And the output should contain no failing features\n"],"status_counts":{"passed":35}} |