howitzer 2.2.0 → 2.3.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (124) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +16 -1
  3. data/LICENSE +1 -1
  4. data/README.md +16 -16
  5. data/generators/base_generator.rb +1 -1
  6. data/generators/config/config_generator.rb +1 -4
  7. data/generators/config/templates/boot.rb +1 -1
  8. data/generators/config/templates/capybara.rb +1 -3
  9. data/generators/config/templates/default.yml +5 -19
  10. data/generators/config/templates/drivers/browserstack.rb +1 -1
  11. data/generators/config/templates/drivers/crossbrowsertesting.rb +1 -1
  12. data/generators/config/templates/drivers/headless_chrome.rb +1 -1
  13. data/generators/config/templates/drivers/headless_firefox.rb +1 -1
  14. data/generators/config/templates/drivers/sauce.rb +1 -1
  15. data/generators/config/templates/drivers/selenium.rb +1 -1
  16. data/generators/config/templates/drivers/selenium_grid.rb +2 -2
  17. data/generators/config/templates/drivers/testingbot.rb +1 -1
  18. data/generators/cucumber/templates/env.rb +1 -1
  19. data/generators/cucumber/templates/hooks.rb +8 -2
  20. data/generators/cucumber/templates/transformers.rb +1 -1
  21. data/generators/prerequisites/templates/factory_bot.rb +1 -1
  22. data/generators/root/templates/Gemfile.erb +4 -10
  23. data/generators/rspec/templates/spec_helper.rb +4 -4
  24. data/generators/turnip/templates/spec_helper.rb +4 -4
  25. data/generators/web/templates/example_page.rb +1 -1
  26. data/lib/howitzer/cache.rb +1 -1
  27. data/lib/howitzer/capybara_helpers.rb +27 -7
  28. data/lib/howitzer/email.rb +2 -2
  29. data/lib/howitzer/exceptions.rb +21 -21
  30. data/lib/howitzer/gmail_api/client.rb +13 -4
  31. data/lib/howitzer/log.rb +6 -6
  32. data/lib/howitzer/mailgun_api/client.rb +3 -2
  33. data/lib/howitzer/mailgun_api/response.rb +1 -2
  34. data/lib/howitzer/mailtrap_api/client.rb +1 -1
  35. data/lib/howitzer/meta/actions.rb +13 -16
  36. data/lib/howitzer/meta/element.rb +12 -10
  37. data/lib/howitzer/utils/string_extensions.rb +6 -2
  38. data/lib/howitzer/version.rb +1 -1
  39. data/lib/howitzer/web/base_section.rb +1 -1
  40. data/lib/howitzer/web/capybara_methods_proxy.rb +11 -5
  41. data/lib/howitzer/web/element_dsl.rb +104 -45
  42. data/lib/howitzer/web/iframe_dsl.rb +2 -2
  43. data/lib/howitzer/web/page.rb +4 -14
  44. data/lib/howitzer/web/page_dsl.rb +15 -6
  45. data/lib/howitzer/web/page_validator.rb +25 -26
  46. data/lib/howitzer/web/section.rb +5 -2
  47. data/lib/howitzer/web/section_dsl.rb +64 -30
  48. data/lib/howitzer.rb +2 -2
  49. metadata +24 -161
  50. data/.coveralls.yml +0 -1
  51. data/.gitignore +0 -14
  52. data/.rspec +0 -3
  53. data/.rubocop.yml +0 -60
  54. data/.ruby-gemset +0 -1
  55. data/.travis.yml +0 -8
  56. data/Gemfile +0 -14
  57. data/ISSUE_TEMPLATE.md +0 -16
  58. data/MAINTENANCE.md +0 -32
  59. data/Rakefile +0 -38
  60. data/features/cli_help.feature +0 -31
  61. data/features/cli_new.feature +0 -393
  62. data/features/cli_unknown.feature +0 -17
  63. data/features/cli_update.feature +0 -223
  64. data/features/cli_version.feature +0 -14
  65. data/features/step_definitions/common_steps.rb +0 -34
  66. data/features/support/env.rb +0 -1
  67. data/generators/config/templates/drivers/poltergeist.rb +0 -11
  68. data/generators/config/templates/drivers/webkit.rb +0 -6
  69. data/generators/root/templates/.gitignore +0 -21
  70. data/generators/root/templates/.rubocop.yml.erb +0 -56
  71. data/generators/turnip/templates/.rspec +0 -1
  72. data/howitzer.gemspec +0 -39
  73. data/lib/howitzer/mail_adapters/debugmail.rb +0 -0
  74. data/spec/config/custom.yml +0 -9
  75. data/spec/spec_helper.rb +0 -73
  76. data/spec/support/generator_helper.rb +0 -21
  77. data/spec/support/logger_helper.rb +0 -13
  78. data/spec/support/shared_examples/capybara_context_holder.rb +0 -33
  79. data/spec/support/shared_examples/capybara_methods_proxy.rb +0 -94
  80. data/spec/support/shared_examples/dynamic_section_methods.rb +0 -35
  81. data/spec/support/shared_examples/element_dsl.rb +0 -242
  82. data/spec/support/shared_examples/meta_highlight_xpath.rb +0 -41
  83. data/spec/unit/generators/base_generator_spec.rb +0 -283
  84. data/spec/unit/generators/config_generator_spec.rb +0 -61
  85. data/spec/unit/generators/cucumber_generator_spec.rb +0 -62
  86. data/spec/unit/generators/emails_generator_spec.rb +0 -35
  87. data/spec/unit/generators/prerequisites_generator_spec.rb +0 -53
  88. data/spec/unit/generators/root_generator_spec.rb +0 -86
  89. data/spec/unit/generators/rspec_generator_spec.rb +0 -36
  90. data/spec/unit/generators/tasks_generator_spec.rb +0 -31
  91. data/spec/unit/generators/templates/cucumber_spec.rb +0 -97
  92. data/spec/unit/generators/templates/rspec_spec.rb +0 -88
  93. data/spec/unit/generators/templates/turnip_spec.rb +0 -98
  94. data/spec/unit/generators/turnip_generator_spec.rb +0 -52
  95. data/spec/unit/generators/web_generator_spec.rb +0 -52
  96. data/spec/unit/lib/cache_spec.rb +0 -85
  97. data/spec/unit/lib/capybara_helpers_spec.rb +0 -730
  98. data/spec/unit/lib/email_spec.rb +0 -186
  99. data/spec/unit/lib/gmail_api/client_spec.rb +0 -26
  100. data/spec/unit/lib/howitzer_spec.rb +0 -92
  101. data/spec/unit/lib/init_spec.rb +0 -2
  102. data/spec/unit/lib/log_spec.rb +0 -122
  103. data/spec/unit/lib/mail_adapters/abstract_spec.rb +0 -62
  104. data/spec/unit/lib/mail_adapters/gmail_spec.rb +0 -128
  105. data/spec/unit/lib/mail_adapters/mailgun_spec.rb +0 -158
  106. data/spec/unit/lib/mail_adapters/mailtrap_spec.rb +0 -130
  107. data/spec/unit/lib/mailgun_api/client_spec.rb +0 -80
  108. data/spec/unit/lib/mailgun_api/connector_spec.rb +0 -54
  109. data/spec/unit/lib/mailgun_api/response_spec.rb +0 -28
  110. data/spec/unit/lib/mailtrap_api/client_spec.rb +0 -67
  111. data/spec/unit/lib/meta/element_spec.rb +0 -59
  112. data/spec/unit/lib/meta/entry_spec.rb +0 -77
  113. data/spec/unit/lib/meta/iframe_spec.rb +0 -66
  114. data/spec/unit/lib/meta/section_spec.rb +0 -43
  115. data/spec/unit/lib/utils/string_extensions_spec.rb +0 -77
  116. data/spec/unit/lib/web/base_section_spec.rb +0 -43
  117. data/spec/unit/lib/web/element_dsl_spec.rb +0 -31
  118. data/spec/unit/lib/web/iframe_dsl_spec.rb +0 -203
  119. data/spec/unit/lib/web/page_dsl_spec.rb +0 -74
  120. data/spec/unit/lib/web/page_spec.rb +0 -385
  121. data/spec/unit/lib/web/page_validator_spec.rb +0 -276
  122. data/spec/unit/lib/web/section_dsl_spec.rb +0 -165
  123. data/spec/unit/lib/web/section_spec.rb +0 -70
  124. data/spec/unit/version_spec.rb +0 -8
@@ -1,52 +0,0 @@
1
- require 'spec_helper'
2
-
3
- RSpec.describe 'Generators' do
4
- let(:destination) { Howitzer::BaseGenerator.destination }
5
- let(:output) { StringIO.new }
6
- subject { file_tree_info(destination) }
7
- before do
8
- Howitzer::BaseGenerator.logger = output
9
- generator_name.new({})
10
- end
11
- after { FileUtils.rm_r(destination) }
12
-
13
- describe Howitzer::WebGenerator do
14
- let(:generator_name) { described_class }
15
- let(:expected_result) do
16
- [
17
- {
18
- name: '/web',
19
- is_directory: true
20
- },
21
- {
22
- name: '/web/pages',
23
- is_directory: true
24
- },
25
- {
26
- name: '/web/pages/example_page.rb',
27
- is_directory: false,
28
- size: template_file_size('web', 'example_page.rb')
29
- },
30
- {
31
- name: '/web/sections',
32
- is_directory: true
33
- },
34
- {
35
- name: '/web/sections/menu_section.rb',
36
- is_directory: false,
37
- size: template_file_size('web', 'menu_section.rb')
38
- }
39
- ]
40
- end
41
- it { is_expected.to eql(expected_result) }
42
- describe 'output' do
43
- let(:expected_output) do
44
- "#{ColorizedString.new(' * PageOriented pattern structure generation ...').light_cyan}
45
- #{ColorizedString.new('Added').light_green} 'web/pages/example_page.rb' file
46
- #{ColorizedString.new('Added').light_green} 'web/sections/menu_section.rb' file\n"
47
- end
48
- subject { output.string }
49
- it { is_expected.to eql(expected_output) }
50
- end
51
- end
52
- end
@@ -1,85 +0,0 @@
1
- require 'spec_helper'
2
- require 'howitzer/cache'
3
-
4
- RSpec.describe Howitzer::Cache do
5
- before { described_class.data.clear }
6
- describe '.store' do
7
- subject { described_class.store(ns, 7, :halt) }
8
- context 'when namespace specified' do
9
- let(:ns) { :user }
10
- it 'should return value' do
11
- is_expected.to eql(:halt)
12
- end
13
- it 'should store namespace value' do
14
- subject
15
- expect(described_class.data[:user]).to eql(7 => :halt)
16
- end
17
- end
18
- context 'when namespace empty' do
19
- let(:ns) { nil }
20
- it { expect { subject }.to raise_error(Howitzer::NoDataError, 'Data storage namespace can not be empty') }
21
- end
22
- end
23
- describe '.extract' do
24
- subject { described_class.extract(ns, key) }
25
- before { described_class.data[:user] = { 7 => :exit } }
26
- describe 'when namespace specified' do
27
- let(:ns) { :user }
28
- context 'and namespace key found' do
29
- let(:key) { 7 }
30
- it { is_expected.to eql(:exit) }
31
- end
32
- context 'and namespace key not found' do
33
- let(:key) { 5 }
34
- it { is_expected.to be_nil }
35
- end
36
- context 'but namespace key not specified' do
37
- let(:key) { nil }
38
- it { is_expected.to eql(7 => :exit) }
39
- end
40
- end
41
- context 'when namespace not found' do
42
- let(:ns) { :guest }
43
- let(:key) { 11 }
44
- it { is_expected.to be_nil }
45
- end
46
- context 'when namespace not specified' do
47
- let(:ns) { nil }
48
- let(:key) { nil }
49
- it { expect { subject }.to raise_error(Howitzer::NoDataError, 'Data storage namespace can not be empty') }
50
- end
51
- end
52
- describe '.clear_ns' do
53
- subject { described_class.clear_ns(:user) }
54
- before { described_class.data[:user] = { 7 => :exit } }
55
- it 'should return empty hash' do
56
- subject
57
- data = described_class.instance_variable_get(:@data)
58
- expect(data[:user]).to eql({})
59
- end
60
- end
61
- describe '.clear_all_ns' do
62
- before do
63
- described_class.store(:cloud, :status, false)
64
- described_class.store(:foo, 'foo', 'some value1')
65
- described_class.store(:bar, 'bar', 'some value2')
66
- described_class.store(:baz, 'baz', 'some value3')
67
- end
68
- context 'when default argument' do
69
- before { described_class.clear_all_ns }
70
- it { expect(described_class.data).to eq(cloud: { status: false }, foo: {}, bar: {}, baz: {}) }
71
- end
72
- context 'when custom argument' do
73
- let(:exception_list) { %i[foo bar] }
74
- before { described_class.clear_all_ns(exception_list) }
75
- it do
76
- expect(described_class.data).to eq(
77
- cloud: {},
78
- foo: { 'foo' => 'some value1' },
79
- bar: { 'bar' => 'some value2' },
80
- baz: {}
81
- )
82
- end
83
- end
84
- end
85
- end