pivotal_to_pdf 1.3.0 → 1.3.1
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +2 -2
- data/lib/pivotal_to_pdf/version.rb +1 -1
- data/spec/pivotal_to_pdf/formatter_factory_spec.rb +1 -1
- data/spec/pivotal_to_pdf_spec.rb +10 -10
- metadata +1 -1
data/README.md
CHANGED
@@ -67,12 +67,12 @@ The gem assumes that you have https access to the pivotal tracker
|
|
67
67
|
|
68
68
|
## Formatters
|
69
69
|
|
70
|
-
From the version 1.
|
70
|
+
From the version 1.3.0, The gem supports alternative formatter other than the default one.
|
71
71
|
In the ```.pivotal.yml``` file, if you define a key like
|
72
72
|
|
73
73
|
```yaml
|
74
74
|
|
75
|
-
formatter: PivotalToPdf::MyPrettyHtmlWriter
|
75
|
+
formatter: PivotalToPdf::Formatters:MyPrettyHtmlWriter
|
76
76
|
```
|
77
77
|
|
78
78
|
The gem will use ```PivotalToPdf::Formatters::MyPrettyHtmlWriter``` to generate the output.
|
@@ -10,7 +10,7 @@ module PivotalToPdf
|
|
10
10
|
context "when the format_class is not defined" do
|
11
11
|
let(:config) { double :config }
|
12
12
|
it "returns the default formatter" do
|
13
|
-
FormatterFactory.formatter.should eq(PivotalToPdf::
|
13
|
+
FormatterFactory.formatter.should eq(PivotalToPdf::Formatters::Default)
|
14
14
|
end
|
15
15
|
end
|
16
16
|
|
data/spec/pivotal_to_pdf_spec.rb
CHANGED
@@ -4,12 +4,12 @@ module PivotalToPdf
|
|
4
4
|
describe Main do
|
5
5
|
let(:writer) {double :writer, :write_to => true}
|
6
6
|
before(:each) do
|
7
|
-
FormatterFactory.stub(:formatter).and_return
|
7
|
+
FormatterFactory.stub(:formatter).and_return Formatters::Default
|
8
8
|
end
|
9
9
|
|
10
10
|
shared_examples "formatter fetching" do
|
11
11
|
it "asks the FormatterFactory for the formatter" do
|
12
|
-
FormatterFactory.should_receive(:formatter).and_return
|
12
|
+
FormatterFactory.should_receive(:formatter).and_return Formatters::Default
|
13
13
|
method.call
|
14
14
|
end
|
15
15
|
end
|
@@ -18,7 +18,7 @@ module PivotalToPdf
|
|
18
18
|
let(:method) { lambda{ Main.story 32 } }
|
19
19
|
before(:each) do
|
20
20
|
Story.stub(:find).and_return story
|
21
|
-
|
21
|
+
Formatters::Default.stub(:new).and_return writer
|
22
22
|
end
|
23
23
|
|
24
24
|
include_examples "formatter fetching"
|
@@ -29,7 +29,7 @@ module PivotalToPdf
|
|
29
29
|
end
|
30
30
|
|
31
31
|
it "build a pdf writer" do
|
32
|
-
|
32
|
+
Formatters::Default.should_receive(:new).with([ story ]).and_return writer
|
33
33
|
Main.story 23
|
34
34
|
end
|
35
35
|
|
@@ -44,7 +44,7 @@ module PivotalToPdf
|
|
44
44
|
let(:method) { lambda{ Main.current_iteration } }
|
45
45
|
before(:each) do
|
46
46
|
Iteration.stub(:find).and_return [iteration, double]
|
47
|
-
|
47
|
+
Formatters::Default.stub(:new).and_return writer
|
48
48
|
end
|
49
49
|
include_examples "formatter fetching"
|
50
50
|
|
@@ -54,7 +54,7 @@ module PivotalToPdf
|
|
54
54
|
end
|
55
55
|
|
56
56
|
it "build a pdf writer" do
|
57
|
-
|
57
|
+
Formatters::Default.should_receive(:new).with(stories).and_return writer
|
58
58
|
Main.current_iteration
|
59
59
|
end
|
60
60
|
|
@@ -70,7 +70,7 @@ module PivotalToPdf
|
|
70
70
|
let(:method) { lambda{ Main.iteration 13 } }
|
71
71
|
before(:each) do
|
72
72
|
Iteration.stub(:find).and_return [iteration, double]
|
73
|
-
|
73
|
+
Formatters::Default.stub(:new).and_return writer
|
74
74
|
end
|
75
75
|
|
76
76
|
include_examples "formatter fetching"
|
@@ -81,7 +81,7 @@ module PivotalToPdf
|
|
81
81
|
end
|
82
82
|
|
83
83
|
it "build a pdf writer" do
|
84
|
-
|
84
|
+
Formatters::Default.should_receive(:new).with(stories).and_return writer
|
85
85
|
Main.iteration 13
|
86
86
|
end
|
87
87
|
|
@@ -96,7 +96,7 @@ module PivotalToPdf
|
|
96
96
|
let(:method) { lambda{ Main.label "testing" } }
|
97
97
|
before(:each) do
|
98
98
|
Story.stub(:find).and_return story
|
99
|
-
|
99
|
+
Formatters::Default.stub(:new).and_return writer
|
100
100
|
end
|
101
101
|
include_examples "formatter fetching"
|
102
102
|
|
@@ -107,7 +107,7 @@ module PivotalToPdf
|
|
107
107
|
end
|
108
108
|
|
109
109
|
it "build a pdf writer" do
|
110
|
-
|
110
|
+
Formatters::Default.should_receive(:new).with(story).and_return writer
|
111
111
|
Main.label "testing"
|
112
112
|
end
|
113
113
|
|