public
Description: Kickstart your Rails app with a blank-slate project configured for RSpec, Haml
Clone URL: git://github.com/mislav/kickstart-rails.git
add HTML::Node#inner_text helper for use with have_tag
mislav (author)
Tue Apr 29 22:22:48 -0700 2008
commit  dc90e62128e50ef8937f2800a10efc4f0a857e98
tree    10a95e8544a9902589b37862c549a2fb9848d8f3
parent  ff658ecd7314284002c775b31c17d4405662f6ef
...
15
16
17
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
...
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
0
@@ -15,3 +15,23 @@ Spec::Runner.configure do |config|
0
   
0
   config.mock_with :mocha
0
 end
0
+
0
+module HTML
0
+ Node.class_eval do
0
+ def inner_text
0
+ children.map(&:inner_text).join('')
0
+ end
0
+ end
0
+
0
+ Text.class_eval do
0
+ def inner_text
0
+ self.to_s
0
+ end
0
+ end
0
+
0
+ Tag.class_eval do
0
+ def inner_text
0
+ childless?? '' : super
0
+ end
0
+ end
0
+end

Comments

    No one has commented yet.