Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Extract part of #remove_past_results and add test
- Loading branch information
Andrew Stewart
committed
Dec 5, 2012
1 parent
7db9d28
commit 1d245a5
Showing
2 changed files
with
72 additions
and
6 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
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 | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,56 @@ | |||
require_relative "../../test_helper" | |||
|
|||
describe Gitnesse::Wiki do | |||
describe "#strip_results" do | |||
let(:wiki_page) do | |||
<<-EOS | |||
```gherkin | |||
Feature: Division | |||
In order to avoid silly mistakes | |||
As a math idiot | |||
I want to be told the quotient of 2 numbers | |||
Scenario: Divide two numbers | |||
Given I have entered 6 into the calculator | |||
And I have entered 2 into the calculator | |||
When I divide | |||
Then the result should be 3 | |||
``` | |||
UNDEFINED: Divide two numbers | |||
PENDING: Divide two numbers | |||
FAILED: Divide two numbers | |||
PASSED: Divide two numbers | |||
EOS | |||
end | |||
|
|||
let(:expected_result) do | |||
<<-EOS | |||
```gherkin | |||
Feature: Division | |||
In order to avoid silly mistakes | |||
As a math idiot | |||
I want to be told the quotient of 2 numbers | |||
Scenario: Divide two numbers | |||
Given I have entered 6 into the calculator | |||
And I have entered 2 into the calculator | |||
When I divide | |||
Then the result should be 3 | |||
``` | |||
EOS | |||
end | |||
|
|||
before do | |||
Gollum::Wiki.expects(:new).returns(mock) | |||
end | |||
|
|||
it "strips old results from the page" do | |||
Gitnesse::Wiki.new(Dir.mktmpdir).strip_results(wiki_page).must_equal expected_result | |||
end | |||
end | |||
end |