flannel 0.1.4 → 0.1.5
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION.yml +1 -1
- data/flannel.gemspec +1 -1
- data/lib/flannel/cutting_board.rb +1 -1
- data/lib/flannel/shears.rb +2 -2
- data/lib/flannel/square.rb +1 -1
- data/lib/flannel/stripe.rb +2 -2
- data/lib/flannel.rb +5 -0
- data/test/stripe_test.rb +15 -8
- metadata +1 -1
data/VERSION.yml
CHANGED
data/flannel.gemspec
CHANGED
data/lib/flannel/shears.rb
CHANGED
data/lib/flannel/square.rb
CHANGED
data/lib/flannel/stripe.rb
CHANGED
data/lib/flannel.rb
CHANGED
data/test/stripe_test.rb
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
require 'test_helper'
|
2
|
-
require 'stripe'
|
2
|
+
#require 'stripe'
|
3
3
|
|
4
4
|
class StripeTest < Test::Unit::TestCase
|
5
5
|
context "basic operations" do
|
@@ -23,24 +23,29 @@ class StripeTest < Test::Unit::TestCase
|
|
23
23
|
context "building wiki links" do
|
24
24
|
setup do
|
25
25
|
wiki_link = lambda { |keyword| "http://www.example.com/foo/#{keyword}"}
|
26
|
-
@stripe = Flannel::Stripe.stitch "the -roof is on fire>", :wiki_link =>
|
26
|
+
@stripe = Flannel::Stripe.stitch "the -roof is on fire>", :wiki_link =>
|
27
|
+
wiki_link
|
27
28
|
end
|
28
29
|
|
29
30
|
should "build wiki links based on a lambda" do
|
30
|
-
assert_equal "http://www.example.com/foo/cheese",
|
31
|
+
assert_equal "http://www.example.com/foo/cheese",
|
32
|
+
@stripe.wiki_link("cheese")
|
31
33
|
end
|
32
34
|
|
33
35
|
should "find and replace wiki link markup" do
|
34
|
-
assert_equal 'the <a href="http://www.example.com/foo/roof-is-on-fire">roof is on fire</a>',
|
36
|
+
assert_equal 'the <a href="http://www.example.com/foo/roof-is-on-fire">roof is on fire</a>',
|
37
|
+
@stripe.to_h
|
35
38
|
end
|
36
39
|
|
37
40
|
should "permalink topics when making wiki links" do
|
38
|
-
assert_equal "http://www.example.com/foo/cheese-tastes-good",
|
41
|
+
assert_equal "http://www.example.com/foo/cheese-tastes-good",
|
42
|
+
@stripe.wiki_link("cheese tastes good")
|
39
43
|
end
|
40
44
|
|
41
45
|
should "not be greedy in matching" do
|
42
46
|
stripe = Flannel::Stripe.stitch("a -foo> and a -bar>.")
|
43
|
-
assert_equal 'a <a href="foo">foo</a> and a <a href="bar">bar</a>.',
|
47
|
+
assert_equal 'a <a href="foo">foo</a> and a <a href="bar">bar</a>.',
|
48
|
+
stripe.build_wiki_links
|
44
49
|
end
|
45
50
|
end
|
46
51
|
|
@@ -69,12 +74,14 @@ class StripeTest < Test::Unit::TestCase
|
|
69
74
|
assert_equal 'red, - green >, refactor', stripe.to_h
|
70
75
|
end
|
71
76
|
|
72
|
-
should "not replace surrounded by - and > with a wiki link if spaced on
|
77
|
+
should "not replace surrounded by - and > with a wiki link if spaced on
|
78
|
+
right" do
|
73
79
|
stripe = Flannel::Stripe.stitch("red, -green >, refactor")
|
74
80
|
assert_equal 'red, -green >, refactor', stripe.to_h
|
75
81
|
end
|
76
82
|
|
77
|
-
should "not replace surrounded by - and > with a wiki link if spaced on
|
83
|
+
should "not replace surrounded by - and > with a wiki link if spaced on
|
84
|
+
left" do
|
78
85
|
stripe = Flannel::Stripe.stitch("red, - green>, refactor")
|
79
86
|
assert_equal 'red, - green>, refactor', stripe.to_h
|
80
87
|
end
|