deas-erbtags 0.4.1 → 0.4.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -17,11 +17,12 @@ module Deas::ErbTags
17
17
  args.last
18
18
  ]
19
19
  opts.update(:href => href.to_s) if !href.nil?
20
+ tag = opts.delete(:tag) || opts.delete('tag') || :a
20
21
 
21
22
  if block_given?
22
- capture_tag(:a, opts, &block)
23
+ capture_tag(tag, opts, &block)
23
24
  else
24
- tag(:a, content || href, opts)
25
+ tag(tag, content || href, opts)
25
26
  end
26
27
  end
27
28
 
@@ -1,4 +1,4 @@
1
1
  module Deas; end
2
2
  module Deas::ErbTags
3
- VERSION = "0.4.1"
3
+ VERSION = "0.4.2"
4
4
  end
@@ -55,6 +55,17 @@ module Deas::ErbTags::LinkTo
55
55
  assert_equal exp, subject.link_to('www.google.com'){ span }
56
56
  end
57
57
 
58
+ should "create a link using a tag other than the anchor tag" do
59
+ href_content = subject.tag(:button, 'google', {:href => 'www.google.com'})
60
+
61
+ assert_equal href_content, subject.link_to('google', 'www.google.com', {
62
+ :tag => 'button'
63
+ })
64
+ assert_equal href_content, subject.link_to('google', 'www.google.com', {
65
+ 'tag' => 'button'
66
+ })
67
+ end
68
+
58
69
  end
59
70
 
60
71
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: deas-erbtags
3
3
  version: !ruby/object:Gem::Version
4
- hash: 13
4
+ hash: 11
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 4
9
- - 1
10
- version: 0.4.1
9
+ - 2
10
+ version: 0.4.2
11
11
  platform: ruby
12
12
  authors:
13
13
  - Kelly Redding
@@ -16,7 +16,7 @@ autorequire:
16
16
  bindir: bin
17
17
  cert_chain: []
18
18
 
19
- date: 2013-05-21 00:00:00 Z
19
+ date: 2013-06-28 00:00:00 Z
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency
22
22
  name: assert