-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add some specs for the progress formatter
- Loading branch information
Showing
1 changed file
with
85 additions
and
0 deletions.
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 |
---|---|---|
@@ -0,0 +1,85 @@ | ||
require 'spec_helper' | ||
require 'cucumber/formatter/spec_helper' | ||
require 'cucumber/formatter/progress' | ||
require 'cucumber/cli/options' | ||
|
||
module Cucumber | ||
module Formatter | ||
describe Progress do | ||
extend SpecHelperDsl | ||
include SpecHelper | ||
|
||
before(:each) do | ||
Cucumber::Term::ANSIColor.coloring = false | ||
@out = StringIO.new | ||
@formatter = Progress.new(runtime, @out, {}) | ||
end | ||
|
||
describe "given a single feature" do | ||
before(:each) do | ||
run_defined_feature | ||
end | ||
|
||
describe "with a scenario" do | ||
define_feature <<-FEATURE | ||
Feature: Banana party | ||
Scenario: Monkey eats banana | ||
Given there are bananas | ||
FEATURE | ||
|
||
it "outputs the undefined step" do | ||
expect(@out.string).to include "U\n" | ||
end | ||
end | ||
|
||
describe "with a background" do | ||
define_feature <<-FEATURE | ||
Feature: Banana party | ||
Background: | ||
Given a tree | ||
Scenario: Monkey eats banana | ||
Given there are bananas | ||
FEATURE | ||
|
||
it "outputs the two undefined steps" do | ||
expect(@out.string).to include "UU\n" | ||
end | ||
end | ||
|
||
describe "with a scenario outline" do | ||
define_feature <<-FEATURE | ||
Feature: Fud Pyramid | ||
Scenario Outline: Monkey eats a balanced diet | ||
Given there are <Things> | ||
Examples: Fruit | ||
| Things | | ||
| apples | | ||
| bananas | | ||
Examples: Vegetables | ||
| Things | | ||
| broccoli | | ||
| carrots | | ||
FEATURE | ||
|
||
it "outputs each undefined step" do | ||
expect(@out.string).to include "UUUU\n" | ||
end | ||
|
||
it "has 4 undefined scenarios" do | ||
expect(@out.string).to include "4 scenarios (4 undefined)" | ||
end | ||
|
||
it "has 4 undefined steps" do | ||
expect(@out.string).to include "4 steps (4 undefined)" | ||
end | ||
|
||
end | ||
end | ||
end | ||
end | ||
end |