Commit d94eed3382ec08292be7b526edc60cbb42b3cc56
- Date: Fri Jun 13 19:01:07 +0000 2008
- Committer: Tim Harper (timcharper@gmail.com)
- Author: Tim Harper (timcharper@gmail.com)
- Commit SHA1: d94eed3382ec08292be7b526edc60cbb42b3cc56
- Tree SHA1: e59bbf853e60bbcdb1b81ce00070602d9d3555dd
added spec for pretty align when multiple occurrences of the given pattern match
Commit diff
| |   |
| 24 | 24 | EOF |
| 25 | 25 | pretty_align("=>", input).should == expected |
| 26 | 26 | end |
| 27 | |
| 28 | it "should align only at the first occurrence of each match" do |
| 29 | input = <<EOF |
| 30 | :name => "Billy bob thorton", |
| 31 | :options => {:backflip => true} |
| 32 | EOF |
| 33 | expected = <<EOF |
| 34 | :name => "Billy bob thorton", |
| 35 | :options => {:backflip => true} |
| 36 | EOF |
| 37 | pretty_align("=>", input).should == expected |
| 38 | end |
| 27 | 39 | end |
| toggle raw diff |
--- a/Support/spec/lib/pretty_align/pretty_align_spec.rb
+++ b/Support/spec/lib/pretty_align/pretty_align_spec.rb
@@ -24,4 +24,16 @@ EOF
EOF
pretty_align("=>", input).should == expected
end
+
+ it "should align only at the first occurrence of each match" do
+ input = <<EOF
+:name => "Billy bob thorton",
+:options => {:backflip => true}
+EOF
+ expected = <<EOF
+:name => "Billy bob thorton",
+:options => {:backflip => true}
+EOF
+ pretty_align("=>", input).should == expected
+ end
end
\ No newline at end of file |