howitzer 2.2.0 → 2.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +16 -1
- data/LICENSE +1 -1
- data/README.md +16 -16
- data/generators/base_generator.rb +1 -1
- data/generators/config/config_generator.rb +1 -4
- data/generators/config/templates/boot.rb +1 -1
- data/generators/config/templates/capybara.rb +1 -3
- data/generators/config/templates/default.yml +5 -19
- data/generators/config/templates/drivers/browserstack.rb +1 -1
- data/generators/config/templates/drivers/crossbrowsertesting.rb +1 -1
- data/generators/config/templates/drivers/headless_chrome.rb +1 -1
- data/generators/config/templates/drivers/headless_firefox.rb +1 -1
- data/generators/config/templates/drivers/sauce.rb +1 -1
- data/generators/config/templates/drivers/selenium.rb +1 -1
- data/generators/config/templates/drivers/selenium_grid.rb +2 -2
- data/generators/config/templates/drivers/testingbot.rb +1 -1
- data/generators/cucumber/templates/env.rb +1 -1
- data/generators/cucumber/templates/hooks.rb +8 -2
- data/generators/cucumber/templates/transformers.rb +1 -1
- data/generators/prerequisites/templates/factory_bot.rb +1 -1
- data/generators/root/templates/Gemfile.erb +4 -10
- data/generators/rspec/templates/spec_helper.rb +4 -4
- data/generators/turnip/templates/spec_helper.rb +4 -4
- data/generators/web/templates/example_page.rb +1 -1
- data/lib/howitzer/cache.rb +1 -1
- data/lib/howitzer/capybara_helpers.rb +27 -7
- data/lib/howitzer/email.rb +2 -2
- data/lib/howitzer/exceptions.rb +21 -21
- data/lib/howitzer/gmail_api/client.rb +13 -4
- data/lib/howitzer/log.rb +6 -6
- data/lib/howitzer/mailgun_api/client.rb +3 -2
- data/lib/howitzer/mailgun_api/response.rb +1 -2
- data/lib/howitzer/mailtrap_api/client.rb +1 -1
- data/lib/howitzer/meta/actions.rb +13 -16
- data/lib/howitzer/meta/element.rb +12 -10
- data/lib/howitzer/utils/string_extensions.rb +6 -2
- data/lib/howitzer/version.rb +1 -1
- data/lib/howitzer/web/base_section.rb +1 -1
- data/lib/howitzer/web/capybara_methods_proxy.rb +11 -5
- data/lib/howitzer/web/element_dsl.rb +104 -45
- data/lib/howitzer/web/iframe_dsl.rb +2 -2
- data/lib/howitzer/web/page.rb +4 -14
- data/lib/howitzer/web/page_dsl.rb +15 -6
- data/lib/howitzer/web/page_validator.rb +25 -26
- data/lib/howitzer/web/section.rb +5 -2
- data/lib/howitzer/web/section_dsl.rb +64 -30
- data/lib/howitzer.rb +2 -2
- metadata +24 -161
- data/.coveralls.yml +0 -1
- data/.gitignore +0 -14
- data/.rspec +0 -3
- data/.rubocop.yml +0 -60
- data/.ruby-gemset +0 -1
- data/.travis.yml +0 -8
- data/Gemfile +0 -14
- data/ISSUE_TEMPLATE.md +0 -16
- data/MAINTENANCE.md +0 -32
- data/Rakefile +0 -38
- data/features/cli_help.feature +0 -31
- data/features/cli_new.feature +0 -393
- data/features/cli_unknown.feature +0 -17
- data/features/cli_update.feature +0 -223
- data/features/cli_version.feature +0 -14
- data/features/step_definitions/common_steps.rb +0 -34
- data/features/support/env.rb +0 -1
- data/generators/config/templates/drivers/poltergeist.rb +0 -11
- data/generators/config/templates/drivers/webkit.rb +0 -6
- data/generators/root/templates/.gitignore +0 -21
- data/generators/root/templates/.rubocop.yml.erb +0 -56
- data/generators/turnip/templates/.rspec +0 -1
- data/howitzer.gemspec +0 -39
- data/lib/howitzer/mail_adapters/debugmail.rb +0 -0
- data/spec/config/custom.yml +0 -9
- data/spec/spec_helper.rb +0 -73
- data/spec/support/generator_helper.rb +0 -21
- data/spec/support/logger_helper.rb +0 -13
- data/spec/support/shared_examples/capybara_context_holder.rb +0 -33
- data/spec/support/shared_examples/capybara_methods_proxy.rb +0 -94
- data/spec/support/shared_examples/dynamic_section_methods.rb +0 -35
- data/spec/support/shared_examples/element_dsl.rb +0 -242
- data/spec/support/shared_examples/meta_highlight_xpath.rb +0 -41
- data/spec/unit/generators/base_generator_spec.rb +0 -283
- data/spec/unit/generators/config_generator_spec.rb +0 -61
- data/spec/unit/generators/cucumber_generator_spec.rb +0 -62
- data/spec/unit/generators/emails_generator_spec.rb +0 -35
- data/spec/unit/generators/prerequisites_generator_spec.rb +0 -53
- data/spec/unit/generators/root_generator_spec.rb +0 -86
- data/spec/unit/generators/rspec_generator_spec.rb +0 -36
- data/spec/unit/generators/tasks_generator_spec.rb +0 -31
- data/spec/unit/generators/templates/cucumber_spec.rb +0 -97
- data/spec/unit/generators/templates/rspec_spec.rb +0 -88
- data/spec/unit/generators/templates/turnip_spec.rb +0 -98
- data/spec/unit/generators/turnip_generator_spec.rb +0 -52
- data/spec/unit/generators/web_generator_spec.rb +0 -52
- data/spec/unit/lib/cache_spec.rb +0 -85
- data/spec/unit/lib/capybara_helpers_spec.rb +0 -730
- data/spec/unit/lib/email_spec.rb +0 -186
- data/spec/unit/lib/gmail_api/client_spec.rb +0 -26
- data/spec/unit/lib/howitzer_spec.rb +0 -92
- data/spec/unit/lib/init_spec.rb +0 -2
- data/spec/unit/lib/log_spec.rb +0 -122
- data/spec/unit/lib/mail_adapters/abstract_spec.rb +0 -62
- data/spec/unit/lib/mail_adapters/gmail_spec.rb +0 -128
- data/spec/unit/lib/mail_adapters/mailgun_spec.rb +0 -158
- data/spec/unit/lib/mail_adapters/mailtrap_spec.rb +0 -130
- data/spec/unit/lib/mailgun_api/client_spec.rb +0 -80
- data/spec/unit/lib/mailgun_api/connector_spec.rb +0 -54
- data/spec/unit/lib/mailgun_api/response_spec.rb +0 -28
- data/spec/unit/lib/mailtrap_api/client_spec.rb +0 -67
- data/spec/unit/lib/meta/element_spec.rb +0 -59
- data/spec/unit/lib/meta/entry_spec.rb +0 -77
- data/spec/unit/lib/meta/iframe_spec.rb +0 -66
- data/spec/unit/lib/meta/section_spec.rb +0 -43
- data/spec/unit/lib/utils/string_extensions_spec.rb +0 -77
- data/spec/unit/lib/web/base_section_spec.rb +0 -43
- data/spec/unit/lib/web/element_dsl_spec.rb +0 -31
- data/spec/unit/lib/web/iframe_dsl_spec.rb +0 -203
- data/spec/unit/lib/web/page_dsl_spec.rb +0 -74
- data/spec/unit/lib/web/page_spec.rb +0 -385
- data/spec/unit/lib/web/page_validator_spec.rb +0 -276
- data/spec/unit/lib/web/section_dsl_spec.rb +0 -165
- data/spec/unit/lib/web/section_spec.rb +0 -70
- 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
|
data/spec/unit/lib/cache_spec.rb
DELETED
@@ -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
|