capybara 0.3.0 → 0.3.5

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.
Files changed (60) hide show
  1. data/Manifest.txt +4 -0
  2. data/README.rdoc +45 -5
  3. data/lib/capybara.rb +11 -4
  4. data/lib/capybara/driver/base.rb +3 -0
  5. data/lib/capybara/driver/celerity_driver.rb +44 -9
  6. data/lib/capybara/driver/rack_test_driver.rb +80 -16
  7. data/lib/capybara/driver/selenium_driver.rb +41 -9
  8. data/lib/capybara/dsl.rb +4 -10
  9. data/lib/capybara/node.rb +8 -0
  10. data/lib/capybara/rails.rb +8 -2
  11. data/lib/capybara/save_and_open_page.rb +5 -1
  12. data/lib/capybara/searchable.rb +17 -9
  13. data/lib/capybara/server.rb +35 -23
  14. data/lib/capybara/session.rb +91 -22
  15. data/lib/capybara/xpath.rb +66 -27
  16. data/spec/driver/celerity_driver_spec.rb +2 -2
  17. data/spec/driver/culerity_driver_spec.rb +1 -2
  18. data/spec/driver/rack_test_driver_spec.rb +0 -1
  19. data/spec/driver/remote_culerity_driver_spec.rb +9 -5
  20. data/spec/driver/selenium_driver_spec.rb +0 -1
  21. data/spec/drivers_spec.rb +24 -32
  22. data/spec/dsl/all_spec.rb +56 -25
  23. data/spec/dsl/attach_file_spec.rb +49 -51
  24. data/spec/dsl/check_spec.rb +12 -1
  25. data/spec/dsl/choose_spec.rb +19 -21
  26. data/spec/dsl/click_button_spec.rb +140 -87
  27. data/spec/dsl/click_link_spec.rb +88 -68
  28. data/spec/dsl/click_spec.rb +20 -22
  29. data/spec/dsl/current_url_spec.rb +6 -8
  30. data/spec/dsl/fill_in_spec.rb +75 -67
  31. data/spec/dsl/find_button_spec.rb +12 -14
  32. data/spec/dsl/find_by_id_spec.rb +16 -0
  33. data/spec/dsl/find_field_spec.rb +17 -19
  34. data/spec/dsl/find_link_spec.rb +13 -15
  35. data/spec/dsl/find_spec.rb +44 -23
  36. data/spec/dsl/has_button_spec.rb +32 -0
  37. data/spec/dsl/has_content_spec.rb +79 -81
  38. data/spec/dsl/has_css_spec.rb +81 -83
  39. data/spec/dsl/has_field_spec.rb +96 -0
  40. data/spec/dsl/has_link_spec.rb +33 -0
  41. data/spec/dsl/has_xpath_spec.rb +97 -89
  42. data/spec/dsl/locate_spec.rb +47 -26
  43. data/spec/dsl/select_spec.rb +61 -17
  44. data/spec/dsl/uncheck_spec.rb +17 -25
  45. data/spec/dsl/within_spec.rb +112 -104
  46. data/spec/public/test.js +3 -0
  47. data/spec/searchable_spec.rb +1 -1
  48. data/spec/server_spec.rb +7 -7
  49. data/spec/session/celerity_session_spec.rb +2 -2
  50. data/spec/session/culerity_session_spec.rb +1 -1
  51. data/spec/session_spec.rb +7 -0
  52. data/spec/session_with_javascript_support_spec.rb +139 -120
  53. data/spec/spec_helper.rb +7 -2
  54. data/spec/test_app.rb +8 -4
  55. data/spec/views/form.erb +50 -2
  56. data/spec/views/tables.erb +61 -1
  57. data/spec/views/with_html.erb +8 -2
  58. data/spec/views/with_js.erb +4 -0
  59. data/spec/xpath_spec.rb +17 -0
  60. metadata +6 -2
@@ -1,24 +1,22 @@
1
- module FindFieldSpec
2
- shared_examples_for "find_field" do
3
- describe '#find_field' do
4
- before do
5
- @session.visit('/form')
6
- end
1
+ shared_examples_for "find_field" do
2
+ describe '#find_field' do
3
+ before do
4
+ @session.visit('/form')
5
+ end
7
6
 
8
- it "should find any field" do
9
- @session.find_field('Dog').value.should == 'dog'
10
- @session.find_field('form_description').text.should == 'Descriptive text goes here'
11
- @session.find_field('Region')[:name].should == 'form[region]'
12
- end
7
+ it "should find any field" do
8
+ @session.find_field('Dog').value.should == 'dog'
9
+ @session.find_field('form_description').text.should == 'Descriptive text goes here'
10
+ @session.find_field('Region')[:name].should == 'form[region]'
11
+ end
13
12
 
14
- it "should be nil if the field doesn't exist" do
15
- @session.find_field('Does not exist').should be_nil
16
- end
13
+ it "should be nil if the field doesn't exist" do
14
+ @session.find_field('Does not exist').should be_nil
15
+ end
17
16
 
18
- it "should be aliased as 'field_labeled' for webrat compatibility" do
19
- @session.field_labeled('Dog').value.should == 'dog'
20
- @session.field_labeled('Does not exist').should be_nil
21
- end
17
+ it "should be aliased as 'field_labeled' for webrat compatibility" do
18
+ @session.field_labeled('Dog').value.should == 'dog'
19
+ @session.field_labeled('Does not exist').should be_nil
22
20
  end
23
21
  end
24
- end
22
+ end
@@ -1,19 +1,17 @@
1
- module FindLinkSpec
2
- shared_examples_for "find_link" do
3
-
4
- describe '#find_link' do
5
- before do
6
- @session.visit('/with_html')
7
- end
1
+ shared_examples_for "find_link" do
8
2
 
9
- it "should find any field" do
10
- @session.find_link('foo').text.should == "ullamco"
11
- @session.find_link('labore')[:href].should == "/with_simple_html"
12
- end
3
+ describe '#find_link' do
4
+ before do
5
+ @session.visit('/with_html')
6
+ end
7
+
8
+ it "should find any field" do
9
+ @session.find_link('foo').text.should == "ullamco"
10
+ @session.find_link('labore')[:href].should == "/with_simple_html"
11
+ end
13
12
 
14
- it "should return nil if the field doesn't exist" do
15
- @session.find_link('Does not exist').should be_nil
16
- end
13
+ it "should return nil if the field doesn't exist" do
14
+ @session.find_link('Does not exist').should be_nil
17
15
  end
18
16
  end
19
- end
17
+ end
@@ -1,36 +1,57 @@
1
- module FindSpec
2
- shared_examples_for "find" do
3
- describe '#find' do
4
- before do
5
- @session.visit('/with_html')
6
- end
1
+ shared_examples_for "find" do
2
+ describe '#find' do
3
+ before do
4
+ @session.visit('/with_html')
5
+ end
6
+
7
+ it "should find the first element using the given locator" do
8
+ @session.find('//h1').text.should == 'This is a test'
9
+ @session.find("//input[@id='test_field']")[:value].should == 'monkey'
10
+ end
7
11
 
12
+ context "with css selectors" do
8
13
  it "should find the first element using the given locator" do
9
- @session.find('//h1').text.should == 'This is a test'
10
- @session.find("//input[@id='test_field']")[:value].should == 'monkey'
14
+ @session.find(:css, 'h1').text.should == 'This is a test'
15
+ @session.find(:css, "input[id='test_field']")[:value].should == 'monkey'
11
16
  end
17
+ end
12
18
 
13
- it "should return nil when nothing was found" do
14
- @session.find('//div[@id="nosuchthing"]').should be_nil
19
+ context "with xpath selectors" do
20
+ it "should find the first element using the given locator" do
21
+ @session.find(:xpath, '//h1').text.should == 'This is a test'
22
+ @session.find(:xpath, "//input[@id='test_field']")[:value].should == 'monkey'
15
23
  end
24
+ end
16
25
 
17
- it "should accept an XPath instance and respect the order of paths" do
18
- @session.visit('/form')
19
- @xpath = Capybara::XPath.text_field('Name')
20
- @session.find(@xpath).value.should == 'John Smith'
26
+ context "with css as default selector" do
27
+ before { Capybara.default_selector = :css }
28
+ it "should find the first element using the given locator" do
29
+ @session.find('h1').text.should == 'This is a test'
30
+ @session.find("input[id='test_field']")[:value].should == 'monkey'
21
31
  end
32
+ after { Capybara.default_selector = :xpath }
33
+ end
22
34
 
23
- context "within a scope" do
24
- before do
25
- @session.visit('/with_scope')
26
- end
35
+ it "should return nil when nothing was found" do
36
+ @session.find('//div[@id="nosuchthing"]').should be_nil
37
+ end
38
+
39
+ it "should accept an XPath instance and respect the order of paths" do
40
+ @session.visit('/form')
41
+ @xpath = Capybara::XPath.text_field('Name')
42
+ @session.find(@xpath).value.should == 'John Smith'
43
+ end
27
44
 
28
- it "should find the first element using the given locator" do
29
- @session.within(:xpath, "//div[@id='for_bar']") do
30
- @session.find('//li').text.should =~ /With Simple HTML/
31
- end
45
+ context "within a scope" do
46
+ before do
47
+ @session.visit('/with_scope')
48
+ end
49
+
50
+ it "should find the first element using the given locator" do
51
+ @session.within(:xpath, "//div[@id='for_bar']") do
52
+ @session.find('//li').text.should =~ /With Simple HTML/
32
53
  end
33
54
  end
34
55
  end
35
56
  end
36
- end
57
+ end
@@ -0,0 +1,32 @@
1
+ shared_examples_for "has_button" do
2
+ describe '#has_button?' do
3
+ before do
4
+ @session.visit('/form')
5
+ end
6
+
7
+ it "should be true if the given button is on the page" do
8
+ @session.should have_button('med')
9
+ @session.should have_button('crap321')
10
+ end
11
+
12
+ it "should be false if the given button is not on the page" do
13
+ @session.should_not have_button('monkey')
14
+ end
15
+ end
16
+
17
+ describe '#has_no_button?' do
18
+ before do
19
+ @session.visit('/form')
20
+ end
21
+
22
+ it "should be true if the given button is on the page" do
23
+ @session.should_not have_no_button('med')
24
+ @session.should_not have_no_button('crap321')
25
+ end
26
+
27
+ it "should be false if the given button is not on the page" do
28
+ @session.should have_no_button('monkey')
29
+ end
30
+ end
31
+ end
32
+
@@ -1,103 +1,101 @@
1
- module HasContentSpec
2
- shared_examples_for "has_content" do
3
- describe '#has_content?' do
4
- it "should be true if the given content is on the page at least once" do
5
- @session.visit('/with_html')
6
- @session.should have_content('est')
7
- @session.should have_content('Lorem')
8
- @session.should have_content('Redirect')
9
- end
10
-
11
- it "should be true if scoped to an element which has the content" do
12
- @session.visit('/with_html')
13
- @session.within("//a[@title='awesome title']") do
14
- @session.should have_content('labore')
15
- end
16
- end
17
-
18
- it "should be false if scoped to an element which does not have the content" do
19
- @session.visit('/with_html')
20
- @session.within("//a[@title='awesome title']") do
21
- @session.should_not have_content('monkey')
22
- end
23
- end
1
+ shared_examples_for "has_content" do
2
+ describe '#has_content?' do
3
+ it "should be true if the given content is on the page at least once" do
4
+ @session.visit('/with_html')
5
+ @session.should have_content('est')
6
+ @session.should have_content('Lorem')
7
+ @session.should have_content('Redirect')
8
+ end
24
9
 
25
- it "should ignore tags" do
26
- @session.visit('/with_html')
27
- @session.should_not have_content('exercitation <a href="/foo" id="foo">ullamco</a> laboris')
28
- @session.should have_content('exercitation ullamco laboris')
10
+ it "should be true if scoped to an element which has the content" do
11
+ @session.visit('/with_html')
12
+ @session.within("//a[@title='awesome title']") do
13
+ @session.should have_content('labore')
29
14
  end
15
+ end
30
16
 
31
- it "should be false if the given content is not on the page" do
32
- @session.visit('/with_html')
33
- @session.should_not have_content('xxxxyzzz')
17
+ it "should be false if scoped to an element which does not have the content" do
18
+ @session.visit('/with_html')
19
+ @session.within("//a[@title='awesome title']") do
34
20
  @session.should_not have_content('monkey')
35
21
  end
22
+ end
36
23
 
37
- it 'should handle single quotes in the content' do
38
- @session.visit('/with-quotes')
39
- @session.should have_content("can't")
40
- end
24
+ it "should ignore tags" do
25
+ @session.visit('/with_html')
26
+ @session.should_not have_content('exercitation <a href="/foo" id="foo">ullamco</a> laboris')
27
+ @session.should have_content('exercitation ullamco laboris')
28
+ end
41
29
 
42
- it 'should handle double quotes in the content' do
43
- @session.visit('/with-quotes')
44
- @session.should have_content(%q{"No," he said})
45
- end
30
+ it "should be false if the given content is not on the page" do
31
+ @session.visit('/with_html')
32
+ @session.should_not have_content('xxxxyzzz')
33
+ @session.should_not have_content('monkey')
34
+ end
46
35
 
47
- it 'should handle mixed single and double quotes in the content' do
48
- @session.visit('/with-quotes')
49
- @session.should have_content(%q{"you can't do that."})
50
- end
36
+ it 'should handle single quotes in the content' do
37
+ @session.visit('/with-quotes')
38
+ @session.should have_content("can't")
51
39
  end
52
40
 
53
- describe '#has_no_content?' do
54
- it "should be false if the given content is on the page at least once" do
55
- @session.visit('/with_html')
56
- @session.should_not have_no_content('est')
57
- @session.should_not have_no_content('Lorem')
58
- @session.should_not have_no_content('Redirect')
59
- end
41
+ it 'should handle double quotes in the content' do
42
+ @session.visit('/with-quotes')
43
+ @session.should have_content(%q{"No," he said})
44
+ end
60
45
 
61
- it "should be false if scoped to an element which has the content" do
62
- @session.visit('/with_html')
63
- @session.within("//a[@title='awesome title']") do
64
- @session.should_not have_no_content('labore')
65
- end
66
- end
46
+ it 'should handle mixed single and double quotes in the content' do
47
+ @session.visit('/with-quotes')
48
+ @session.should have_content(%q{"you can't do that."})
49
+ end
50
+ end
67
51
 
68
- it "should be true if scoped to an element which does not have the content" do
69
- @session.visit('/with_html')
70
- @session.within("//a[@title='awesome title']") do
71
- @session.should have_no_content('monkey')
72
- end
73
- end
52
+ describe '#has_no_content?' do
53
+ it "should be false if the given content is on the page at least once" do
54
+ @session.visit('/with_html')
55
+ @session.should_not have_no_content('est')
56
+ @session.should_not have_no_content('Lorem')
57
+ @session.should_not have_no_content('Redirect')
58
+ end
74
59
 
75
- it "should ignore tags" do
76
- @session.visit('/with_html')
77
- @session.should have_no_content('exercitation <a href="/foo" id="foo">ullamco</a> laboris')
78
- @session.should_not have_no_content('exercitation ullamco laboris')
60
+ it "should be false if scoped to an element which has the content" do
61
+ @session.visit('/with_html')
62
+ @session.within("//a[@title='awesome title']") do
63
+ @session.should_not have_no_content('labore')
79
64
  end
65
+ end
80
66
 
81
- it "should be true if the given content is not on the page" do
82
- @session.visit('/with_html')
83
- @session.should have_no_content('xxxxyzzz')
67
+ it "should be true if scoped to an element which does not have the content" do
68
+ @session.visit('/with_html')
69
+ @session.within("//a[@title='awesome title']") do
84
70
  @session.should have_no_content('monkey')
85
71
  end
72
+ end
86
73
 
87
- it 'should handle single quotes in the content' do
88
- @session.visit('/with-quotes')
89
- @session.should_not have_no_content("can't")
90
- end
74
+ it "should ignore tags" do
75
+ @session.visit('/with_html')
76
+ @session.should have_no_content('exercitation <a href="/foo" id="foo">ullamco</a> laboris')
77
+ @session.should_not have_no_content('exercitation ullamco laboris')
78
+ end
91
79
 
92
- it 'should handle double quotes in the content' do
93
- @session.visit('/with-quotes')
94
- @session.should_not have_no_content(%q{"No," he said})
95
- end
80
+ it "should be true if the given content is not on the page" do
81
+ @session.visit('/with_html')
82
+ @session.should have_no_content('xxxxyzzz')
83
+ @session.should have_no_content('monkey')
84
+ end
96
85
 
97
- it 'should handle mixed single and double quotes in the content' do
98
- @session.visit('/with-quotes')
99
- @session.should_not have_no_content(%q{"you can't do that."})
100
- end
86
+ it 'should handle single quotes in the content' do
87
+ @session.visit('/with-quotes')
88
+ @session.should_not have_no_content("can't")
89
+ end
90
+
91
+ it 'should handle double quotes in the content' do
92
+ @session.visit('/with-quotes')
93
+ @session.should_not have_no_content(%q{"No," he said})
94
+ end
95
+
96
+ it 'should handle mixed single and double quotes in the content' do
97
+ @session.visit('/with-quotes')
98
+ @session.should_not have_no_content(%q{"you can't do that."})
101
99
  end
102
100
  end
103
- end
101
+ end
@@ -1,109 +1,107 @@
1
- module HasCssSpec
2
- shared_examples_for "has_css" do
3
- describe '#has_css?' do
4
- before do
5
- @session.visit('/with_html')
6
- end
1
+ shared_examples_for "has_css" do
2
+ describe '#has_css?' do
3
+ before do
4
+ @session.visit('/with_html')
5
+ end
6
+
7
+ it "should be true if the given selector is on the page" do
8
+ @session.should have_css("p")
9
+ @session.should have_css("p a#foo")
10
+ end
11
+
12
+ it "should be false if the given selector is not on the page" do
13
+ @session.should_not have_css("abbr")
14
+ @session.should_not have_css("p a#doesnotexist")
15
+ @session.should_not have_css("p.nosuchclass")
16
+ end
7
17
 
8
- it "should be true if the given selector is on the page" do
9
- @session.should have_css("p")
10
- @session.should have_css("p a#foo")
18
+ it "should respect scopes" do
19
+ @session.within "//p[@id='first']" do
20
+ @session.should have_css("a#foo")
21
+ @session.should_not have_css("a#red")
11
22
  end
23
+ end
12
24
 
13
- it "should be false if the given selector is not on the page" do
14
- @session.should_not have_css("abbr")
15
- @session.should_not have_css("p a#doesnotexist")
16
- @session.should_not have_css("p.nosuchclass")
25
+ context "with count" do
26
+ it "should be true if the content is on the page the given number of times" do
27
+ @session.should have_css("p", :count => 3)
28
+ @session.should have_css("p a#foo", :count => 1)
17
29
  end
18
30
 
19
- it "should respect scopes" do
20
- @session.within "//p[@id='first']" do
21
- @session.should have_css("a#foo")
22
- @session.should_not have_css("a#red")
23
- end
31
+ it "should be false if the content is on the page the given number of times" do
32
+ @session.should_not have_css("p", :count => 6)
33
+ @session.should_not have_css("p a#foo", :count => 2)
24
34
  end
25
35
 
26
- context "with count" do
27
- it "should be true if the content is on the page the given number of times" do
28
- @session.should have_css("p", :count => 3)
29
- @session.should have_css("p a#foo", :count => 1)
30
- end
31
-
32
- it "should be false if the content is on the page the given number of times" do
33
- @session.should_not have_css("p", :count => 6)
34
- @session.should_not have_css("p a#foo", :count => 2)
35
- end
36
-
37
- it "should be false if the content isn't on the page at all" do
38
- @session.should_not have_css("abbr", :count => 2)
39
- @session.should_not have_css("p a.doesnotexist", :count => 1)
40
- end
36
+ it "should be false if the content isn't on the page at all" do
37
+ @session.should_not have_css("abbr", :count => 2)
38
+ @session.should_not have_css("p a.doesnotexist", :count => 1)
41
39
  end
40
+ end
42
41
 
43
- context "with text" do
44
- it "should discard all matches where the given string is not contained" do
45
- @session.should have_css("p a", :text => "Redirect", :count => 1)
46
- @session.should_not have_css("p a", :text => "Doesnotexist")
47
- end
42
+ context "with text" do
43
+ it "should discard all matches where the given string is not contained" do
44
+ @session.should have_css("p a", :text => "Redirect", :count => 1)
45
+ @session.should_not have_css("p a", :text => "Doesnotexist")
46
+ end
48
47
 
49
- it "should discard all matches where the given regexp is not matched" do
50
- @session.should have_css("p a", :text => /re[dab]i/i, :count => 1)
51
- @session.should_not have_css("p a", :text => /Red$/)
52
- end
48
+ it "should discard all matches where the given regexp is not matched" do
49
+ @session.should have_css("p a", :text => /re[dab]i/i, :count => 1)
50
+ @session.should_not have_css("p a", :text => /Red$/)
53
51
  end
54
52
  end
53
+ end
55
54
 
56
- describe '#has_no_css?' do
57
- before do
58
- @session.visit('/with_html')
59
- end
55
+ describe '#has_no_css?' do
56
+ before do
57
+ @session.visit('/with_html')
58
+ end
60
59
 
61
- it "should be false if the given selector is on the page" do
62
- @session.should_not have_no_css("p")
63
- @session.should_not have_no_css("p a#foo")
60
+ it "should be false if the given selector is on the page" do
61
+ @session.should_not have_no_css("p")
62
+ @session.should_not have_no_css("p a#foo")
63
+ end
64
+
65
+ it "should be true if the given selector is not on the page" do
66
+ @session.should have_no_css("abbr")
67
+ @session.should have_no_css("p a#doesnotexist")
68
+ @session.should have_no_css("p.nosuchclass")
69
+ end
70
+
71
+ it "should respect scopes" do
72
+ @session.within "//p[@id='first']" do
73
+ @session.should_not have_no_css("a#foo")
74
+ @session.should have_no_css("a#red")
64
75
  end
76
+ end
65
77
 
66
- it "should be true if the given selector is not on the page" do
67
- @session.should have_no_css("abbr")
68
- @session.should have_no_css("p a#doesnotexist")
69
- @session.should have_no_css("p.nosuchclass")
78
+ context "with count" do
79
+ it "should be false if the content is on the page the given number of times" do
80
+ @session.should_not have_no_css("p", :count => 3)
81
+ @session.should_not have_no_css("p a#foo", :count => 1)
70
82
  end
71
83
 
72
- it "should respect scopes" do
73
- @session.within "//p[@id='first']" do
74
- @session.should_not have_no_css("a#foo")
75
- @session.should have_no_css("a#red")
76
- end
84
+ it "should be true if the content is on the page the given number of times" do
85
+ @session.should have_no_css("p", :count => 6)
86
+ @session.should have_no_css("p a#foo", :count => 2)
77
87
  end
78
88
 
79
- context "with count" do
80
- it "should be false if the content is on the page the given number of times" do
81
- @session.should_not have_no_css("p", :count => 3)
82
- @session.should_not have_no_css("p a#foo", :count => 1)
83
- end
84
-
85
- it "should be true if the content is on the page the given number of times" do
86
- @session.should have_no_css("p", :count => 6)
87
- @session.should have_no_css("p a#foo", :count => 2)
88
- end
89
-
90
- it "should be true if the content isn't on the page at all" do
91
- @session.should have_no_css("abbr", :count => 2)
92
- @session.should have_no_css("p a.doesnotexist", :count => 1)
93
- end
89
+ it "should be true if the content isn't on the page at all" do
90
+ @session.should have_no_css("abbr", :count => 2)
91
+ @session.should have_no_css("p a.doesnotexist", :count => 1)
94
92
  end
93
+ end
95
94
 
96
- context "with text" do
97
- it "should discard all matches where the given string is not contained" do
98
- @session.should_not have_no_css("p a", :text => "Redirect", :count => 1)
99
- @session.should have_no_css("p a", :text => "Doesnotexist")
100
- end
95
+ context "with text" do
96
+ it "should discard all matches where the given string is not contained" do
97
+ @session.should_not have_no_css("p a", :text => "Redirect", :count => 1)
98
+ @session.should have_no_css("p a", :text => "Doesnotexist")
99
+ end
101
100
 
102
- it "should discard all matches where the given regexp is not matched" do
103
- @session.should_not have_no_css("p a", :text => /re[dab]i/i, :count => 1)
104
- @session.should have_no_css("p a", :text => /Red$/)
105
- end
101
+ it "should discard all matches where the given regexp is not matched" do
102
+ @session.should_not have_no_css("p a", :text => /re[dab]i/i, :count => 1)
103
+ @session.should have_no_css("p a", :text => /Red$/)
106
104
  end
107
105
  end
108
106
  end
109
- end
107
+ end