howitzer 2.1.1 → 2.4.0

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 (129) hide show
  1. checksums.yaml +5 -5
  2. data/CHANGELOG.md +44 -1
  3. data/LICENSE +1 -1
  4. data/README.md +19 -17
  5. data/generators/base_generator.rb +5 -7
  6. data/generators/config/config_generator.rb +3 -4
  7. data/generators/config/templates/boot.rb +2 -2
  8. data/generators/config/templates/capybara.rb +4 -5
  9. data/generators/config/templates/default.yml +21 -11
  10. data/generators/config/templates/drivers/browserstack.rb +31 -4
  11. data/generators/config/templates/drivers/crossbrowsertesting.rb +9 -11
  12. data/generators/config/templates/drivers/headless_chrome.rb +1 -1
  13. data/generators/config/templates/drivers/headless_firefox.rb +23 -0
  14. data/generators/config/templates/drivers/lambdatest.rb +30 -0
  15. data/generators/config/templates/drivers/sauce.rb +30 -2
  16. data/generators/config/templates/drivers/selenium.rb +1 -1
  17. data/generators/config/templates/drivers/selenium_grid.rb +3 -3
  18. data/generators/config/templates/drivers/testingbot.rb +29 -2
  19. data/generators/cucumber/templates/cuke_sniffer.rake +2 -2
  20. data/generators/cucumber/templates/env.rb +8 -0
  21. data/generators/cucumber/templates/hooks.rb +9 -3
  22. data/generators/cucumber/templates/transformers.rb +1 -1
  23. data/generators/prerequisites/templates/factory_bot.rb +2 -1
  24. data/generators/root/root_generator.rb +1 -1
  25. data/generators/root/templates/Gemfile.erb +4 -10
  26. data/generators/rspec/templates/spec_helper.rb +6 -5
  27. data/generators/turnip/templates/spec_helper.rb +6 -5
  28. data/generators/web/templates/example_page.rb +1 -1
  29. data/lib/howitzer/cache.rb +20 -19
  30. data/lib/howitzer/capybara_helpers.rb +59 -14
  31. data/lib/howitzer/email.rb +3 -2
  32. data/lib/howitzer/exceptions.rb +21 -21
  33. data/lib/howitzer/gmail_api/client.rb +13 -4
  34. data/lib/howitzer/log.rb +6 -6
  35. data/lib/howitzer/mail_adapters/gmail.rb +3 -0
  36. data/lib/howitzer/mail_adapters/mailgun.rb +3 -1
  37. data/lib/howitzer/mail_adapters/mailtrap.rb +3 -0
  38. data/lib/howitzer/mailgun_api/client.rb +3 -2
  39. data/lib/howitzer/mailgun_api/connector.rb +1 -0
  40. data/lib/howitzer/mailgun_api/response.rb +1 -2
  41. data/lib/howitzer/mailtrap_api/client.rb +1 -1
  42. data/lib/howitzer/meta/actions.rb +35 -0
  43. data/lib/howitzer/meta/element.rb +40 -0
  44. data/lib/howitzer/meta/entry.rb +62 -0
  45. data/lib/howitzer/meta/iframe.rb +41 -0
  46. data/lib/howitzer/meta/section.rb +30 -0
  47. data/lib/howitzer/meta.rb +11 -0
  48. data/lib/howitzer/utils/string_extensions.rb +6 -2
  49. data/lib/howitzer/version.rb +1 -1
  50. data/lib/howitzer/web/base_section.rb +1 -1
  51. data/lib/howitzer/web/capybara_context_holder.rb +1 -0
  52. data/lib/howitzer/web/capybara_methods_proxy.rb +15 -6
  53. data/lib/howitzer/web/element_dsl.rb +104 -44
  54. data/lib/howitzer/web/iframe_dsl.rb +4 -2
  55. data/lib/howitzer/web/page.rb +14 -14
  56. data/lib/howitzer/web/page_dsl.rb +18 -6
  57. data/lib/howitzer/web/page_validator.rb +27 -26
  58. data/lib/howitzer/web/section.rb +13 -2
  59. data/lib/howitzer/web/section_dsl.rb +65 -30
  60. data/lib/howitzer.rb +40 -0
  61. metadata +31 -157
  62. data/.coveralls.yml +0 -1
  63. data/.gitignore +0 -14
  64. data/.rspec +0 -3
  65. data/.rubocop.yml +0 -51
  66. data/.ruby-gemset +0 -1
  67. data/.travis.yml +0 -7
  68. data/Gemfile +0 -14
  69. data/ISSUE_TEMPLATE.md +0 -16
  70. data/MAINTENANCE.md +0 -32
  71. data/Rakefile +0 -38
  72. data/features/cli_help.feature +0 -31
  73. data/features/cli_new.feature +0 -389
  74. data/features/cli_unknown.feature +0 -17
  75. data/features/cli_update.feature +0 -218
  76. data/features/cli_version.feature +0 -14
  77. data/features/step_definitions/common_steps.rb +0 -34
  78. data/features/support/env.rb +0 -1
  79. data/generators/config/templates/drivers/phantomjs.rb +0 -19
  80. data/generators/config/templates/drivers/poltergeist.rb +0 -11
  81. data/generators/config/templates/drivers/webkit.rb +0 -6
  82. data/generators/root/templates/.gitignore +0 -21
  83. data/generators/root/templates/.rubocop.yml +0 -35
  84. data/generators/turnip/templates/.rspec +0 -1
  85. data/howitzer.gemspec +0 -39
  86. data/lib/howitzer/mail_adapters/debugmail.rb +0 -0
  87. data/spec/config/custom.yml +0 -9
  88. data/spec/spec_helper.rb +0 -73
  89. data/spec/support/generator_helper.rb +0 -21
  90. data/spec/support/logger_helper.rb +0 -13
  91. data/spec/support/shared_examples/capybara_context_holder.rb +0 -33
  92. data/spec/support/shared_examples/capybara_methods_proxy.rb +0 -94
  93. data/spec/support/shared_examples/dynamic_section_methods.rb +0 -35
  94. data/spec/support/shared_examples/element_dsl.rb +0 -242
  95. data/spec/unit/generators/base_generator_spec.rb +0 -283
  96. data/spec/unit/generators/config_generator_spec.rb +0 -59
  97. data/spec/unit/generators/cucumber_generator_spec.rb +0 -62
  98. data/spec/unit/generators/emails_generator_spec.rb +0 -35
  99. data/spec/unit/generators/prerequisites_generator_spec.rb +0 -53
  100. data/spec/unit/generators/root_generator_spec.rb +0 -75
  101. data/spec/unit/generators/rspec_generator_spec.rb +0 -36
  102. data/spec/unit/generators/tasks_generator_spec.rb +0 -31
  103. data/spec/unit/generators/turnip_generator_spec.rb +0 -52
  104. data/spec/unit/generators/web_generator_spec.rb +0 -52
  105. data/spec/unit/lib/cache_spec.rb +0 -85
  106. data/spec/unit/lib/capybara_helpers_spec.rb +0 -697
  107. data/spec/unit/lib/email_spec.rb +0 -186
  108. data/spec/unit/lib/gmail_api/client_spec.rb +0 -26
  109. data/spec/unit/lib/howitzer_spec.rb +0 -69
  110. data/spec/unit/lib/init_spec.rb +0 -2
  111. data/spec/unit/lib/log_spec.rb +0 -122
  112. data/spec/unit/lib/mail_adapters/abstract_spec.rb +0 -62
  113. data/spec/unit/lib/mail_adapters/gmail_spec.rb +0 -128
  114. data/spec/unit/lib/mail_adapters/mailgun_spec.rb +0 -158
  115. data/spec/unit/lib/mail_adapters/mailtrap_spec.rb +0 -130
  116. data/spec/unit/lib/mailgun_api/client_spec.rb +0 -80
  117. data/spec/unit/lib/mailgun_api/connector_spec.rb +0 -54
  118. data/spec/unit/lib/mailgun_api/response_spec.rb +0 -28
  119. data/spec/unit/lib/mailtrap_api/client_spec.rb +0 -67
  120. data/spec/unit/lib/utils/string_extensions_spec.rb +0 -77
  121. data/spec/unit/lib/web/base_section_spec.rb +0 -43
  122. data/spec/unit/lib/web/element_dsl_spec.rb +0 -22
  123. data/spec/unit/lib/web/iframe_dsl_spec.rb +0 -203
  124. data/spec/unit/lib/web/page_dsl_spec.rb +0 -74
  125. data/spec/unit/lib/web/page_spec.rb +0 -378
  126. data/spec/unit/lib/web/page_validator_spec.rb +0 -276
  127. data/spec/unit/lib/web/section_dsl_spec.rb +0 -165
  128. data/spec/unit/lib/web/section_spec.rb +0 -63
  129. data/spec/unit/version_spec.rb +0 -8
@@ -1,276 +0,0 @@
1
- require 'spec_helper'
2
- require 'howitzer/web/page_validator'
3
- require 'howitzer/web/element_dsl'
4
-
5
- RSpec.describe Howitzer::Web::PageValidator do
6
- describe '.validations' do
7
- it { expect(subject.validations).to be_a(Hash) }
8
- end
9
-
10
- let(:web_page_class) do
11
- Class.new do
12
- include Howitzer::Web::ElementDsl
13
- include Howitzer::Web::PageValidator
14
- element :foo, 'a'
15
- element :bar, :xpath, ->(v) { v }
16
- def self.name
17
- 'TestWebPageClass'
18
- end
19
- end
20
- end
21
- let(:web_page) { web_page_class.new }
22
- describe '#check_validations_are_defined!' do
23
- subject { web_page.check_validations_are_defined! }
24
- context 'when no validation specified' do
25
- it do
26
- expect { subject }.to raise_error(
27
- Howitzer::NoValidationError,
28
- "No any page validation was found for 'TestWebPageClass' page"
29
- )
30
- end
31
- end
32
- context 'when title validation is specified' do
33
- before do
34
- web_page.class.validate :title, /Foo/
35
- end
36
- it { expect { subject }.to_not raise_error }
37
- end
38
- context 'when url validation is specified' do
39
- before do
40
- web_page.class.validate :url, /Foo/
41
- end
42
- it { expect { subject }.to_not raise_error }
43
- end
44
- context 'when element_presence validation is specified' do
45
- context 'when simple selector' do
46
- before do
47
- web_page.class.validate :element_presence, :foo
48
- end
49
- it { expect { subject }.to_not raise_error }
50
- end
51
-
52
- context 'when lambda selector' do
53
- before do
54
- web_page.class.validate :element_presence, :bar, 'some_text'
55
- end
56
- it { expect { subject }.to_not raise_error }
57
- end
58
- end
59
- end
60
-
61
- describe '.validate' do
62
- before do
63
- described_class.validations[web_page.class] = nil
64
- end
65
- let(:additional_value) { nil }
66
- subject { web_page.class.validate(name, *[value, additional_value].compact) }
67
- context 'when name = :url' do
68
- context 'as string' do
69
- let(:name) { 'url' }
70
- context '(as string)' do
71
- let(:value) { 'foo' }
72
- it do
73
- is_expected.to be_a(Proc)
74
- expect(described_class.validations[web_page.class][:url]).to be_a Proc
75
- end
76
- end
77
- context '(as regexp)' do
78
- let(:value) { /foo/ }
79
- it do
80
- is_expected.to be_a(Proc)
81
- expect(described_class.validations[web_page.class][:url]).to be_a Proc
82
- end
83
- end
84
- end
85
- context 'as symbol' do
86
- let(:name) { :url }
87
- let(:value) { /foo/ }
88
- it do
89
- is_expected.to be_a(Proc)
90
- expect(described_class.validations[web_page.class][:url]).to be_a Proc
91
- end
92
- end
93
- end
94
- context 'when name = :element_presence' do
95
- let(:name) { :element_presence }
96
- context '(as string)' do
97
- let(:value) { 'bar' }
98
- let(:additional_value) { 'some string' }
99
- it do
100
- is_expected.to be_a(Proc)
101
- expect(described_class.validations[web_page.class][:element_presence]).to eql(subject)
102
- end
103
- end
104
- context '(as symbol)' do
105
- let(:value) { :foo }
106
- it do
107
- is_expected.to be_a(Proc)
108
- expect(described_class.validations[web_page.class][:element_presence]).to eql(subject)
109
- end
110
- end
111
-
112
- context 'when refers to unknown element' do
113
- let(:value) { :unknown }
114
- it do
115
- subject
116
- expect do
117
- described_class.validations[web_page.class][:element_presence].call(web_page, false)
118
- end.to raise_error(
119
- Howitzer::UndefinedElementError,
120
- ":element_presence validation refers to undefined 'unknown' element on 'TestWebPageClass' page."
121
- )
122
- end
123
- end
124
- end
125
- context 'when name = :title' do
126
- let(:name) { :title }
127
- context '(as string)' do
128
- let(:value) { 'foo' }
129
- it do
130
- is_expected.to be_a(Proc)
131
- expect(described_class.validations[web_page.class][:title]).to be_a Proc
132
- end
133
- end
134
- context '(as regexp)' do
135
- let(:value) { /foo/ }
136
- it do
137
- is_expected.to be_a(Proc)
138
- expect(described_class.validations[web_page.class][:title]).to be_a Proc
139
- end
140
- end
141
- end
142
- context 'when other name' do
143
- let(:name) { :unknown }
144
- let(:value) { '' }
145
- it do
146
- expect { subject }.to raise_error(Howitzer::UnknownValidationError, "unknown 'unknown' validation type")
147
- end
148
- end
149
- end
150
-
151
- describe '.opened?' do
152
- context 'when no one validation is defined' do
153
- subject { web_page_class.opened? }
154
- it do
155
- expect { subject }.to raise_error(
156
- Howitzer::NoValidationError,
157
- "No any page validation was found for 'TestWebPageClass' page"
158
- )
159
- end
160
- end
161
- context 'when all validations are defined' do
162
- context 'when sync is default' do
163
- subject { web_page_class.opened? }
164
- before do
165
- web_page_class.class_eval do
166
- include Singleton
167
- element :login, '#id'
168
- validate :url, /foo/
169
- validate :title, /Foo page/
170
- validate :element_presence, :login
171
- end
172
- end
173
- context 'when all matches' do
174
- before do
175
- allow(web_page_class.instance).to receive(:current_url).and_return('http://test.com/foo')
176
- allow(web_page_class.instance).to receive(:has_title?).and_return('Foo page')
177
- allow(web_page_class.instance).to receive(:has_login_element?).with(no_args).and_return(true)
178
- end
179
- it { is_expected.to be_truthy }
180
- end
181
- context 'when first validation fails' do
182
- before do
183
- expect(web_page_class.instance).to receive(:current_url).once.and_return('http://test.com/bar')
184
- expect(web_page_class.instance).to receive(:has_title?).never
185
- allow(web_page_class).to receive(:has_login_element?).with(no_args).never
186
- end
187
- it { is_expected.to be_falsey }
188
- end
189
- end
190
-
191
- context 'when sync is true' do
192
- subject { web_page_class.opened?(sync: true) }
193
- before do
194
- web_page_class.class_eval do
195
- include Singleton
196
- element :login, '#id'
197
- validate :url, /foo/
198
- validate :title, /Foo page/
199
- validate :element_presence, :login
200
- end
201
- end
202
- context 'when all matches' do
203
- before do
204
- allow(web_page_class.instance).to receive(:current_url).and_return('http://test.com/foo')
205
- allow(web_page_class.instance).to receive(:has_title?).and_return('Foo page')
206
- allow(web_page_class.instance).to receive(:has_login_element?).with(no_args).and_return(true)
207
- end
208
- it { is_expected.to be_truthy }
209
- end
210
- context 'when first validation fails' do
211
- before do
212
- expect(web_page_class.instance).to receive(:current_url).once.and_return('http://test.com/bar')
213
- expect(web_page_class.instance).to receive(:has_title?).never
214
- allow(web_page_class).to receive(:has_login_element?).with(no_args).never
215
- end
216
- it { is_expected.to be_falsey }
217
- end
218
- end
219
-
220
- context 'when sync is false' do
221
- subject { web_page_class.opened?(sync: false) }
222
- before do
223
- web_page_class.class_eval do
224
- include Singleton
225
- element :login, '#id'
226
- validate :url, /foo/
227
- validate :title, /Foo page/
228
- validate :element_presence, :login
229
- end
230
- end
231
- context 'when all matches' do
232
- before do
233
- allow(web_page_class.instance).to receive(:current_url).and_return('http://test.com/foo')
234
- allow(web_page_class.instance).to receive(:title).and_return('Foo page')
235
- allow(web_page_class.instance).to receive(:has_no_login_element?).with(no_args).and_return(false)
236
- end
237
- it { is_expected.to be_truthy }
238
- end
239
- context 'when first validation fails' do
240
- before do
241
- expect(web_page_class.instance).to receive(:current_url).once.and_return('http://test.com/bar')
242
- expect(web_page_class.instance).to receive(:title).never
243
- allow(web_page_class).to receive(:has_no_login_element?).with(no_args).never
244
- end
245
- it { is_expected.to be_falsey }
246
- end
247
- end
248
- end
249
- end
250
-
251
- describe 'web_page.validations' do
252
- it { expect(web_page_class.validations).to be_a(Hash) }
253
- end
254
-
255
- describe '#matched_pages' do
256
- let!(:web_page1_class) do
257
- Class.new do
258
- include Howitzer::Web::PageValidator
259
- end
260
- end
261
- let!(:web_page2_class) do
262
- Class.new do
263
- include Howitzer::Web::PageValidator
264
- end
265
- end
266
- subject { web_page2_class.matched_pages }
267
- before do
268
- allow(Howitzer::Web::PageValidator).to receive(:validations).with(no_args) do
269
- { web_page1_class => 1, web_page2_class => 2 }
270
- end
271
- expect(web_page1_class).to receive(:opened?).with(sync: false).and_return(true)
272
- expect(web_page2_class).to receive(:opened?).with(sync: false).and_return(false)
273
- end
274
- it { is_expected.to eq([web_page1_class]) }
275
- end
276
- end
@@ -1,165 +0,0 @@
1
- require 'spec_helper'
2
- require 'howitzer/web/section'
3
-
4
- RSpec.describe Howitzer::Web::SectionDsl do
5
- let(:section_class) do
6
- Class.new(Howitzer::Web::Section) do
7
- me :xpath, './/div'
8
- end
9
- end
10
- let(:web_page_class) do
11
- Class.new do
12
- include Howitzer::Web::SectionDsl
13
-
14
- def capybara_context
15
- Capybara.current_session
16
- end
17
- end
18
- end
19
- before { stub_const('FooSection', section_class) }
20
- describe '.section' do
21
- subject do
22
- web_page_class.class_eval do
23
- section :foo
24
- end
25
- web_page_class
26
- end
27
-
28
- it 'should create public :foo_section instance method' do
29
- expect(subject.new.public_methods(false)).to include(:foo_section)
30
- end
31
- it 'should create public :foo_sections instance method' do
32
- expect(subject.new.public_methods(false)).to include(:foo_sections)
33
- end
34
- it 'should create public :has_foo_section? instance method' do
35
- expect(subject.new.public_methods(false)).to include(:has_foo_section?)
36
- end
37
- it 'should create public :has_no_foo_section? instance method' do
38
- expect(subject.new.public_methods(false)).to include(:has_no_foo_section?)
39
- end
40
- it 'should be protected class method' do
41
- expect { subject.section :bar }.to raise_error(NoMethodError)
42
- expect(subject.protected_methods(true)).to include(:section)
43
- end
44
- end
45
-
46
- describe 'Dsl on section' do
47
- let(:other_section_class) do
48
- Class.new(Howitzer::Web::Section) do
49
- me '#id'
50
- element :baz, '.klass'
51
- end
52
- end
53
- let(:parent) { double }
54
- let(:capybara_context) { double }
55
- let(:nested_capybara_context) { double }
56
- let(:capybara_element) { double }
57
- subject { section_class.new(parent, capybara_context) }
58
- before do
59
- stub_const('BarSection', other_section_class)
60
- section_class.class_eval do
61
- section :bar
62
- end
63
- expect(capybara_context).to receive(:find).with('#id').at_least(:once) { nested_capybara_context }
64
- expect(nested_capybara_context).to receive(:find).with('.klass') { capybara_element }
65
- end
66
- it 'can work with nested section' do
67
- expect(subject.bar_section).to be_a(other_section_class)
68
- expect(subject.bar_section.private_methods(false)).to include(:baz_element)
69
- expect(subject.bar_section.send(:baz_element)).to eq(capybara_element)
70
- end
71
- end
72
-
73
- describe 'Dsl on page' do
74
- let(:session) { double(:session) }
75
- before do
76
- allow(Capybara).to receive(:current_session) { session }
77
- end
78
- context 'when section with single argument without block' do
79
- let(:finder_args) { [:xpath, './/div'] }
80
- let(:section_name) { :foo }
81
- before do
82
- web_page_class.class_eval do
83
- section :foo
84
- end
85
- end
86
- include_examples :dynamic_section_methods
87
- end
88
-
89
- context 'when section with single argument and block' do
90
- subject do
91
- web_page_class.class_eval do
92
- section :unknown do
93
- element :some, :id, 'do_do'
94
- end
95
- end
96
- end
97
- it 'should generate error' do
98
- expect { subject }.to raise_error(ArgumentError, 'Missing finder arguments')
99
- end
100
- end
101
-
102
- context 'when section with 2 arguments without block' do
103
- let(:finder_args) { ['.some_class'] }
104
- let(:section_name) { :foo }
105
- before do
106
- web_page_class.class_eval do
107
- section :foo, '.some_class'
108
- end
109
- end
110
- include_examples :dynamic_section_methods
111
- end
112
-
113
- context 'when section with 2 arguments and block' do
114
- let(:finder_args) { [:xpath, './/div'] }
115
- let(:section_name) { :unknown }
116
- let(:section_class) { Howitzer::Web::BaseSection }
117
- before do
118
- web_page_class.class_eval do
119
- section :unknown, :xpath, './/div' do
120
- element :some, :id, 'do_do'
121
- end
122
- end
123
- end
124
- include_examples :dynamic_section_methods
125
- end
126
-
127
- context 'when nested section with 2 arguments and block' do
128
- let(:finder_args) { [:xpath, './/div'] }
129
- let(:section_name) { :name1 }
130
- let(:section_class) { Howitzer::Web::BaseSection }
131
- before do
132
- web_page_class.class_eval do
133
- section :name1, :xpath, './/div' do
134
- element :some1, :id, 'do_do'
135
-
136
- section :name2, '#klass' do
137
- element :some2, :xpath, './/a'
138
- end
139
- end
140
- end
141
- end
142
-
143
- include_examples :dynamic_section_methods
144
- include_examples :capybara_context_holder
145
-
146
- context 'checking nested level' do
147
- let(:context2) { double }
148
- let(:context3) { double }
149
- let(:capybara_element) { double }
150
- before do
151
- expect(session).to receive(:find).with(*finder_args).once.and_return(context2)
152
- expect(context2).to receive(:find).with('#klass').and_return(context3)
153
- expect(context3).to receive(:find).with(:xpath, './/a').and_return(capybara_element)
154
- end
155
-
156
- it 'can work with nested section' do
157
- nested_section = web_page_class.new.name1_section.name2_section
158
- expect(nested_section).to be_a(section_class)
159
- expect(nested_section.private_methods(false)).to include(:some2_element)
160
- expect(nested_section.send(:some2_element)).to eq(capybara_element)
161
- end
162
- end
163
- end
164
- end
165
- end
@@ -1,63 +0,0 @@
1
- require 'spec_helper'
2
- require 'howitzer/web/section_dsl'
3
- require 'howitzer/web/section'
4
- RSpec.describe Howitzer::Web::Section do
5
- describe 'element dsl methods' do
6
- let(:parent) { double }
7
- let(:capybara_context) { double }
8
-
9
- let(:klass) { Class.new(described_class) }
10
- let(:klass_object) { klass.new(parent, capybara_context) }
11
-
12
- it 'returns correct capybara context' do
13
- expect(klass_object.capybara_context).to eq(capybara_context)
14
- end
15
-
16
- include_examples :element_dsl
17
- end
18
-
19
- describe 'DSL' do
20
- describe '.me' do
21
- let(:section_class) { Class.new(described_class) }
22
- context 'when args missing' do
23
- it { expect { section_class.send(:me) }.to raise_error(ArgumentError, 'Finder arguments are missing') }
24
- end
25
-
26
- context 'when args present' do
27
- subject { section_class.send(:me, '.foo') }
28
- it { is_expected.to eq(['.foo']) }
29
- end
30
-
31
- it 'should be private' do
32
- expect { section_class.me('.foo') }.to raise_error(NoMethodError)
33
- end
34
- end
35
- end
36
-
37
- describe '.default_finder_args' do
38
- context 'by default' do
39
- subject { described_class.default_finder_args }
40
- it { is_expected.to be_nil }
41
- end
42
-
43
- context 'when defined via dsl' do
44
- let(:section_class) do
45
- Class.new(described_class) do
46
- me :xpath, './/div'
47
- end
48
- end
49
- subject { section_class.default_finder_args }
50
- it { is_expected.to eq([:xpath, './/div']) }
51
- end
52
- end
53
-
54
- describe '#parent' do
55
- subject { described_class.new(:test, 1).parent }
56
- it { is_expected.to eq(:test) }
57
- end
58
-
59
- describe '#capybara_context' do
60
- subject { described_class.new(1, :test).capybara_context }
61
- it { is_expected.to eq(:test) }
62
- end
63
- end
@@ -1,8 +0,0 @@
1
- require 'spec_helper'
2
-
3
- RSpec.describe Howitzer do
4
- it { expect(subject.constants).to include(:VERSION) }
5
- it 'should contains VERSION constant with correct format' do
6
- expect(Howitzer::VERSION).to match(/^\d+\.\d+(\.\d+)?$/)
7
- end
8
- end