kelp 0.1.1 → 0.1.2

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 (56) hide show
  1. data/.gitignore +2 -0
  2. data/.yardopts +6 -0
  3. data/Gemfile +4 -9
  4. data/Gemfile.lock +8 -0
  5. data/History.md +22 -0
  6. data/README.md +154 -7
  7. data/kelp.gemspec +1 -1
  8. data/lib/kelp.rb +8 -1
  9. data/lib/kelp/attribute.rb +31 -0
  10. data/lib/kelp/checkbox.rb +31 -0
  11. data/lib/kelp/dropdown.rb +109 -0
  12. data/lib/kelp/field.rb +159 -0
  13. data/lib/kelp/helper.rb +14 -0
  14. data/lib/kelp/navigation.rb +63 -0
  15. data/lib/kelp/scoping.rb +45 -0
  16. data/lib/kelp/visibility.rb +176 -0
  17. data/lib/kelp/xpath.rb +14 -0
  18. data/spec/attribute_spec.rb +56 -0
  19. data/spec/checkbox_spec.rb +69 -0
  20. data/spec/dropdown_spec.rb +176 -0
  21. data/spec/field_spec.rb +290 -0
  22. data/spec/navigation_spec.rb +89 -0
  23. data/spec/scoping_spec.rb +0 -0
  24. data/spec/{capybara/spec_helper.rb → spec_helper.rb} +9 -5
  25. data/spec/test_app/views/form.erb +24 -0
  26. data/spec/visibility_spec.rb +315 -0
  27. data/spec/xpath_spec.rb +0 -0
  28. data/step_definitions/capybara_steps.rb +132 -0
  29. metadata +25 -32
  30. data/docs/Makefile +0 -130
  31. data/docs/_static/custom.css +0 -9
  32. data/docs/conf.py +0 -217
  33. data/docs/development.rst +0 -27
  34. data/docs/future.rst +0 -9
  35. data/docs/index.rst +0 -33
  36. data/docs/make.bat +0 -155
  37. data/docs/testing.rst +0 -15
  38. data/docs/usage.rst +0 -85
  39. data/lib/kelp/capybara.rb +0 -2
  40. data/lib/kelp/capybara/capybara_steps.rb +0 -225
  41. data/lib/kelp/capybara/form_helper.rb +0 -131
  42. data/lib/kelp/capybara/web_helper.rb +0 -148
  43. data/spec/capybara/click_link_in_row_spec.rb +0 -24
  44. data/spec/capybara/dropdown_spec.rb +0 -112
  45. data/spec/capybara/field_should_be_empty_spec.rb +0 -44
  46. data/spec/capybara/field_should_contain_spec.rb +0 -143
  47. data/spec/capybara/fill_in_fields_spec.rb +0 -67
  48. data/spec/capybara/follow_spec.rb +0 -35
  49. data/spec/capybara/page_should_have_spec.rb +0 -48
  50. data/spec/capybara/page_should_not_have_spec.rb +0 -53
  51. data/spec/capybara/press_spec.rb +0 -33
  52. data/spec/capybara/should_be_disabled_spec.rb +0 -28
  53. data/spec/capybara/should_be_enabled_spec.rb +0 -29
  54. data/spec/capybara/should_not_see_spec.rb +0 -97
  55. data/spec/capybara/should_see_in_same_row_spec.rb +0 -41
  56. data/spec/capybara/should_see_spec.rb +0 -80
@@ -1,97 +0,0 @@
1
- require File.expand_path(File.dirname(__FILE__) + '/spec_helper')
2
-
3
- describe WebHelper, "#should_not_see" do
4
- before(:each) do
5
- visit('/home')
6
- end
7
-
8
- context "passes when" do
9
- context "String" do
10
- it "does not exist" do
11
- should_not_see "Goodbye cruel world"
12
- end
13
-
14
- it "none of several strings exist" do
15
- should_not_see [
16
- "Hello nurse",
17
- "Goodbye cruel world"
18
- ]
19
- end
20
-
21
- it "exists but is not within the scope" do
22
- should_not_see "Goodbye world", :within => "#greeting"
23
- end
24
- end
25
-
26
- context "Regexp" do
27
- it "does not match" do
28
- should_not_see /(Yo|Wazzup) world/
29
- end
30
-
31
- it "none of several regexps match" do
32
- should_not_see [
33
- /(Yo|Wazzup) world/,
34
- /(Ciao|Later) world/
35
- ]
36
- end
37
-
38
- it "matches but is not within the scope" do
39
- should_not_see /Goodbye world/, :within => "#greeting"
40
- end
41
- end
42
- end
43
-
44
-
45
- context "fails when" do
46
- context "String" do
47
- it "exists" do
48
- lambda do
49
- should_not_see "Hello world"
50
- end.should raise_error
51
- end
52
-
53
- it "any of several exist" do
54
- lambda do
55
- should_not_see [
56
- "Hello nurse",
57
- "Goodbye cruel world",
58
- "Goodbye world"
59
- ]
60
- end.should raise_error
61
- end
62
-
63
- it "exists within the scope" do
64
- lambda do
65
- should_not_see "Hello world", :within => "#greeting"
66
- end.should raise_error
67
- end
68
- end
69
-
70
- context "Regexp" do
71
- it "matches" do
72
- lambda do
73
- should_not_see /(Hello|Goodbye) world/
74
- end.should raise_error
75
- end
76
-
77
- it "any of several regexps match" do
78
- lambda do
79
- should_not_see [
80
- /(Yo|Wazzup) world/,
81
- /(Ciao|Later) world/,
82
- /(Hello|Goodbye) world/
83
- ]
84
- end.should raise_error
85
- end
86
-
87
- it "matches within the scope" do
88
- lambda do
89
- should_not_see /(Hello|Goodbye) world/, :within => "#greeting"
90
- end.should raise_error
91
- end
92
- end
93
-
94
- end
95
- end
96
-
97
-
@@ -1,41 +0,0 @@
1
- require File.expand_path(File.dirname(__FILE__) + '/spec_helper')
2
-
3
- describe WebHelper, "#should_see_in_same_row" do
4
- before(:each) do
5
- visit('/home')
6
- end
7
-
8
- context "passes when" do
9
- it "two strings are in the same row" do
10
- should_see_in_same_row ["Eric", "Edit"]
11
- should_see_in_same_row ["John", "Edit"]
12
- should_see_in_same_row ["Terry", "Edit"]
13
- end
14
-
15
- it "three strings are in the same row" do
16
- should_see_in_same_row ["Eric", "555-4444", "Edit"]
17
- should_see_in_same_row ["John", "666-5555", "Edit"]
18
- should_see_in_same_row ["Terry", "777-6666", "Edit"]
19
- end
20
- end
21
- end
22
-
23
- describe WebHelper, "#should_see_in_same_row" do
24
- before(:each) do
25
- visit('/home')
26
- end
27
-
28
- context "passes when" do
29
- it "two strings are not in the same row" do
30
- should_not_see_in_same_row ["Eric", "Delete"]
31
- should_not_see_in_same_row ["John", "Delete"]
32
- should_not_see_in_same_row ["Terry", "Delete"]
33
- end
34
-
35
- it "any two of three strings are not in the same row" do
36
- should_not_see_in_same_row ["Eric", "555-4444", "Delete"]
37
- should_not_see_in_same_row ["John", "666-5555", "Delete"]
38
- should_not_see_in_same_row ["Terry", "777-6666", "Delete"]
39
- end
40
- end
41
- end
@@ -1,80 +0,0 @@
1
- require File.expand_path(File.dirname(__FILE__) + '/spec_helper')
2
-
3
- describe WebHelper, "#should_see" do
4
- before(:each) do
5
- visit('/home')
6
- end
7
-
8
- context "passes when" do
9
- context "String" do
10
- it "exists" do
11
- should_see "Hello world"
12
- should_see "Goodbye world"
13
- end
14
-
15
- it "multiple exist" do
16
- should_see [
17
- "Hello world",
18
- "Goodbye world"
19
- ]
20
- end
21
-
22
- it "is within the scope" do
23
- should_see "Hello world", :within => "#greeting"
24
- end
25
- end
26
-
27
- context "Regexp" do
28
- it "matches" do
29
- should_see /(Hello|Goodbye) world/
30
- end
31
-
32
- it "matches within the scope" do
33
- should_see /(Hello|Goodbye) world/, :within => "#greeting"
34
- should_see /(Hello|Goodbye) world/, :within => "#farewell"
35
- end
36
- end
37
- end
38
-
39
- context "fails when" do
40
- context "String" do
41
- it "does not exist" do
42
- lambda do
43
- should_see "Goodbye cruel world"
44
- end.should raise_error
45
- end
46
-
47
- it "any of several do not exist" do
48
- lambda do
49
- should_see [
50
- "Hello world",
51
- "Goodbye world",
52
- "Hello, nurse!"
53
- ]
54
- end.should raise_error
55
- end
56
-
57
- it "is not within the scope" do
58
- lambda do
59
- should_see "Goodbye world", :within => "#greeting"
60
- end.should raise_error
61
- end
62
- end
63
-
64
- context "Regexp" do
65
- it "does not match" do
66
- lambda do
67
- should_see /(Yo|Wazzup) world/
68
- end.should raise_error
69
- end
70
-
71
- it "matches but is not within the scope" do
72
- lambda do
73
- should_see /Goodbye world/, :within => "#greeting"
74
- end.should raise_error
75
- end
76
- end
77
- end
78
-
79
- end
80
-