reason 0.0.1 → 0.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/features/documentation.feature +24 -1
- data/lib/reason.rb +5 -1
- data/lib/reason/version.rb +1 -1
- metadata +3 -3
@@ -15,7 +15,6 @@ Feature: Documentation formatter support
|
|
15
15
|
"""
|
16
16
|
|
17
17
|
Scenario: Displaying reason for an "it" block
|
18
|
-
Scenario: More complex matchers with a reason
|
19
18
|
Given a file named "spec/simple_spec.rb" with:
|
20
19
|
"""
|
21
20
|
require "spec_helper"
|
@@ -39,3 +38,27 @@ Feature: Documentation formatter support
|
|
39
38
|
should support concatenation
|
40
39
|
-> because NaturalLanguageProcessor uses this in its .greeting_generator method
|
41
40
|
"""
|
41
|
+
|
42
|
+
Scenario: Display normal output if no because
|
43
|
+
Given a file named "spec/simple_spec.rb" with:
|
44
|
+
"""
|
45
|
+
require "spec_helper"
|
46
|
+
|
47
|
+
describe String do
|
48
|
+
subject { "a simple string" }
|
49
|
+
let(:welcome_message) { "Hello" }
|
50
|
+
let(:name) { "Steve Yadlowsky" }
|
51
|
+
|
52
|
+
it "should support concatenation" do
|
53
|
+
greeting = welcome_message + ", " + name
|
54
|
+
greeting.should == "Hello, Steve Yadlowsky"
|
55
|
+
end
|
56
|
+
end
|
57
|
+
"""
|
58
|
+
When I run `rspec spec --format documentation`
|
59
|
+
Then it should pass with:
|
60
|
+
"""
|
61
|
+
String
|
62
|
+
should support concatenation
|
63
|
+
"""
|
64
|
+
|
data/lib/reason.rb
CHANGED
@@ -21,7 +21,11 @@ module Reason
|
|
21
21
|
def self.print_for(example, options={})
|
22
22
|
depth = options[:depth] || 0
|
23
23
|
indentation = " " * depth
|
24
|
-
|
24
|
+
if explanations[example]
|
25
|
+
"#{indentation}-> because #{explanations[example].join("\n#{indentation}->")}"
|
26
|
+
else
|
27
|
+
""
|
28
|
+
end
|
25
29
|
end
|
26
30
|
end
|
27
31
|
end
|
data/lib/reason/version.rb
CHANGED
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: reason
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 27
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
version: 0.0.
|
9
|
+
- 2
|
10
|
+
version: 0.0.2
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Steve Yadlowsky
|