howitzer 1.0.2 → 1.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.coveralls.yml +1 -0
- data/.gitignore +3 -1
- data/.ruby-gemset +1 -0
- data/.travis.yml +4 -1
- data/.yardopts +5 -0
- data/CHANGELOG.md +23 -1
- data/CONTRIBUTING.md +14 -0
- data/GETTING_STARTED.md +283 -183
- data/Gemfile +3 -2
- data/LICENSE +1 -1
- data/README.md +93 -39
- data/Rakefile +4 -0
- data/bin/howitzer +34 -5
- data/features/cli_help.feature +3 -2
- data/features/cli_new.feature +1 -1
- data/features/cli_unknown.feature +1 -1
- data/features/cli_update.feature +84 -0
- data/features/step_definitions/common_steps.rb +9 -1
- data/generators/base_generator.rb +30 -15
- data/generators/config/config_generator.rb +7 -7
- data/generators/config/templates/custom.yml +1 -0
- data/generators/config/templates/default.yml +35 -5
- data/generators/cucumber/templates/env.rb +2 -2
- data/generators/cucumber/templates/transformers.rb +3 -1
- data/generators/root/templates/Gemfile +5 -3
- data/generators/root/templates/Rakefile +2 -0
- data/generators/rspec/templates/example_spec.rb +3 -3
- data/generators/rspec/templates/spec_helper.rb +6 -7
- data/howitzer.gemspec +15 -15
- data/lib/howitzer/capybara/settings.rb +125 -49
- data/lib/howitzer/helpers.rb +161 -94
- data/lib/howitzer/mailgun/client.rb +1 -1
- data/lib/howitzer/tasks/framework.rake +3 -0
- data/lib/howitzer/utils.rb +1 -1
- data/lib/howitzer/utils/locator_store.rb +1 -1
- data/lib/howitzer/utils/log.rb +1 -1
- data/lib/howitzer/utils/page_validator.rb +1 -1
- data/lib/howitzer/version.rb +1 -1
- data/lib/howitzer/web_page.rb +11 -11
- data/spec/spec_helper.rb +25 -22
- data/spec/support/generator_helper.rb +8 -1
- data/spec/unit/generators/base_generator_spec.rb +242 -0
- data/spec/unit/generators/config_generator_spec.rb +34 -0
- data/spec/unit/generators/cucumber_generator_spec.rb +45 -0
- data/spec/unit/generators/emails_generator_spec.rb +31 -0
- data/spec/unit/generators/pages_generator_spec.rb +33 -0
- data/spec/unit/generators/root_generator_spec.rb +35 -0
- data/spec/unit/generators/rspec_generator_spec.rb +36 -0
- data/spec/unit/generators/tasks_generator_spec.rb +31 -0
- data/spec/unit/lib/capybara/dsl_ex_spec.rb +11 -11
- data/spec/unit/lib/capybara/settings_spec.rb +336 -58
- data/spec/unit/lib/email_spec.rb +17 -17
- data/spec/unit/lib/helpers_spec.rb +699 -315
- data/spec/unit/lib/mailgun/client_spec.rb +9 -9
- data/spec/unit/lib/mailgun/connector_spec.rb +20 -20
- data/spec/unit/lib/mailgun/response_spec.rb +9 -9
- data/spec/unit/lib/settings_spec.rb +6 -6
- data/spec/unit/lib/utils/data_generator/data_storage_spec.rb +31 -31
- data/spec/unit/lib/utils/data_generator/gen_spec.rb +20 -20
- data/spec/unit/lib/utils/locator_store_spec.rb +39 -39
- data/spec/unit/lib/utils/log_spec.rb +42 -42
- data/spec/unit/lib/utils/page_validator_spec.rb +69 -70
- data/spec/unit/lib/web_page_spec.rb +91 -69
- data/spec/unit/version_spec.rb +3 -3
- metadata +100 -78
- data/spec/unit/generators/generators_spec.rb +0 -175
@@ -1,175 +0,0 @@
|
|
1
|
-
require 'spec_helper'
|
2
|
-
require 'fileutils'
|
3
|
-
|
4
|
-
Dir[File.join(generators_path, '**', '*_generator.rb')].each{ |f| require f }
|
5
|
-
|
6
|
-
describe "Generators" do
|
7
|
-
let(:destination) { Dir.mktmpdir }
|
8
|
-
let(:output) { StringIO.new }
|
9
|
-
subject { file_tree_info(destination) }
|
10
|
-
before do
|
11
|
-
Howitzer::BaseGenerator.logger = output
|
12
|
-
Howitzer::BaseGenerator.destination = destination
|
13
|
-
generator_name.new
|
14
|
-
end
|
15
|
-
|
16
|
-
after { FileUtils.rm_r(destination) }
|
17
|
-
|
18
|
-
describe "ConfigGenerator" do
|
19
|
-
let(:generator_name) { Howitzer::ConfigGenerator }
|
20
|
-
let(:expected_result) do
|
21
|
-
[
|
22
|
-
{:name=>"/config", :is_directory=>true},
|
23
|
-
{:name=>"/config/custom.yml", :is_directory=>false, :size=>template_file_size('config', 'custom.yml')},
|
24
|
-
{:name=>"/config/default.yml", :is_directory=>false, :size=>template_file_size('config', 'default.yml')}
|
25
|
-
]
|
26
|
-
end
|
27
|
-
|
28
|
-
it { expect(subject).to eql(expected_result) }
|
29
|
-
describe "output" do
|
30
|
-
let(:expected_output) do
|
31
|
-
" * Config files generation ...
|
32
|
-
Added 'config/custom.yml' file
|
33
|
-
Added 'config/default.yml' file\n"
|
34
|
-
end
|
35
|
-
subject { output.string }
|
36
|
-
it { expect(subject).to eql(expected_output) }
|
37
|
-
end
|
38
|
-
end
|
39
|
-
describe "PagesGenerator" do
|
40
|
-
let(:generator_name) { Howitzer::PagesGenerator }
|
41
|
-
let(:expected_result) do
|
42
|
-
[
|
43
|
-
{:name=>"/pages", :is_directory=>true},
|
44
|
-
{:name=>"/pages/example_menu.rb", :is_directory=>false, :size=>template_file_size('pages', 'example_menu.rb')},
|
45
|
-
{:name=>"/pages/example_page.rb", :is_directory=>false, :size=>template_file_size('pages', 'example_page.rb')}
|
46
|
-
]
|
47
|
-
end
|
48
|
-
it { expect(subject).to eql(expected_result) }
|
49
|
-
describe "output" do
|
50
|
-
let(:expected_output) do
|
51
|
-
" * PageOriented pattern structure generation ...
|
52
|
-
Added 'pages/example_page.rb' file
|
53
|
-
Added 'pages/example_menu.rb' file\n"
|
54
|
-
end
|
55
|
-
subject { output.string }
|
56
|
-
it { expect(subject).to eql(expected_output) }
|
57
|
-
end
|
58
|
-
end
|
59
|
-
describe "TasksGenerator" do
|
60
|
-
let(:generator_name) { Howitzer::TasksGenerator }
|
61
|
-
let(:expected_result) do
|
62
|
-
[
|
63
|
-
{:name=>"/tasks", :is_directory=>true},
|
64
|
-
{:name=>"/tasks/common.rake", :is_directory=>false, :size=>template_file_size('tasks', 'common.rake')}
|
65
|
-
]
|
66
|
-
end
|
67
|
-
it { expect(subject).to eql(expected_result) }
|
68
|
-
describe "output" do
|
69
|
-
let(:expected_output) do
|
70
|
-
" * Base rake task generation ...
|
71
|
-
Added 'tasks/common.rake' file\n"
|
72
|
-
end
|
73
|
-
subject { output.string }
|
74
|
-
it { expect(subject).to eql(expected_output) }
|
75
|
-
end
|
76
|
-
end
|
77
|
-
describe "EmailsGenerator" do
|
78
|
-
let(:generator_name) { Howitzer::EmailsGenerator }
|
79
|
-
let(:expected_result) do
|
80
|
-
[
|
81
|
-
{:name=>"/emails", :is_directory=>true},
|
82
|
-
{:name=>"/emails/example_email.rb", :is_directory=>false, :size=>template_file_size('emails', 'example_email.rb')}
|
83
|
-
]
|
84
|
-
end
|
85
|
-
it { expect(subject).to eql(expected_result) }
|
86
|
-
describe "output" do
|
87
|
-
let(:expected_output) do
|
88
|
-
" * Email example generation ...
|
89
|
-
Added '/emails/example_email.rb' file\n"
|
90
|
-
end
|
91
|
-
subject { output.string }
|
92
|
-
it { expect(subject).to eql(expected_output) }
|
93
|
-
end
|
94
|
-
end
|
95
|
-
describe "RootGenerator" do
|
96
|
-
let(:generator_name) { Howitzer::RootGenerator }
|
97
|
-
let(:expected_result) do
|
98
|
-
[
|
99
|
-
{:name=>"/Gemfile", :is_directory=>false, :size=>template_file_size('root', 'Gemfile')},
|
100
|
-
{:name=>"/Rakefile", :is_directory=>false, :size=>template_file_size('root', 'Rakefile')},
|
101
|
-
{:name=>"/boot.rb", :is_directory=>false, :size=>template_file_size('root', 'boot.rb')}
|
102
|
-
]
|
103
|
-
end
|
104
|
-
it { expect(subject).to eql(expected_result) }
|
105
|
-
describe "output" do
|
106
|
-
let(:expected_output) do
|
107
|
-
" * Root files generation ...
|
108
|
-
Added '.gitignore' file
|
109
|
-
Added 'Gemfile' file
|
110
|
-
Added 'Rakefile' file
|
111
|
-
Added 'boot.rb' file\n"
|
112
|
-
end
|
113
|
-
subject { output.string }
|
114
|
-
it { expect(subject).to eql(expected_output) }
|
115
|
-
end
|
116
|
-
end
|
117
|
-
describe "CucumberGenerator" do
|
118
|
-
let(:generator_name) { Howitzer::CucumberGenerator }
|
119
|
-
let(:expected_result) do
|
120
|
-
[
|
121
|
-
{:name=>"/config", :is_directory=>true},
|
122
|
-
{:name=>"/config/cucumber.yml", :is_directory=>false, :size=>template_file_size('cucumber', 'cucumber.yml')},
|
123
|
-
{:name=>"/features", :is_directory=>true},
|
124
|
-
{:name=>"/features/example.feature", :is_directory=>false, :size=>template_file_size('cucumber', 'example.feature')},
|
125
|
-
{:name=>"/features/step_definitions", :is_directory=>true},
|
126
|
-
{:name=>"/features/step_definitions/common_steps.rb", :is_directory=>false, :size=>template_file_size('cucumber', 'common_steps.rb')},
|
127
|
-
{:name=>"/features/support", :is_directory=>true},
|
128
|
-
{:name=>"/features/support/env.rb", :is_directory=>false, :size=>template_file_size('cucumber', 'env.rb')},
|
129
|
-
{:name=>"/features/support/transformers.rb", :is_directory=>false, :size=>template_file_size('cucumber', 'transformers.rb')},
|
130
|
-
{:name=>"/tasks", :is_directory=>true},
|
131
|
-
{:name=>"/tasks/cucumber.rake", :is_directory=>false, :size=>template_file_size('cucumber', 'cucumber.rake')}
|
132
|
-
]
|
133
|
-
end
|
134
|
-
it { expect(subject).to eql(expected_result) }
|
135
|
-
describe "output" do
|
136
|
-
let(:expected_output) do
|
137
|
-
" * Cucumber integration to the framework ...
|
138
|
-
Added 'features/step_definitions/common_steps.rb' file
|
139
|
-
Added 'features/support/env.rb' file
|
140
|
-
Added 'features/support/transformers.rb' file
|
141
|
-
Added 'features/example.feature' file
|
142
|
-
Added 'tasks/cucumber.rake' file
|
143
|
-
Added 'config/cucumber.yml' file\n"
|
144
|
-
end
|
145
|
-
subject { output.string }
|
146
|
-
it { expect(subject).to eql(expected_output) }
|
147
|
-
end
|
148
|
-
end
|
149
|
-
describe "RSpecGenerator" do
|
150
|
-
let(:generator_name) { Howitzer::RspecGenerator }
|
151
|
-
let(:expected_result) do
|
152
|
-
[
|
153
|
-
{:name=>"/spec", :is_directory=>true},
|
154
|
-
{:name=>"/spec/example_spec.rb", :is_directory=>false, :size=>template_file_size('rspec', 'example_spec.rb')},
|
155
|
-
{:name=>"/spec/spec_helper.rb", :is_directory=>false, :size=>template_file_size('rspec', 'spec_helper.rb')},
|
156
|
-
{:name=>"/tasks", :is_directory=>true},
|
157
|
-
{:name=>"/tasks/rspec.rake", :is_directory=>false, :size=>template_file_size('rspec', 'rspec.rake')}
|
158
|
-
]
|
159
|
-
end
|
160
|
-
it { expect(subject).to eql(expected_result) }
|
161
|
-
describe "output" do
|
162
|
-
let(:expected_output) do
|
163
|
-
" * RSpec integration to the framework ...
|
164
|
-
Added 'spec/spec_helper.rb' file
|
165
|
-
Added 'spec/example_spec.rb' file
|
166
|
-
Added 'tasks/rspec.rake' file\n"
|
167
|
-
end
|
168
|
-
subject { output.string }
|
169
|
-
it { expect(subject).to eql(expected_output) }
|
170
|
-
end
|
171
|
-
end
|
172
|
-
|
173
|
-
|
174
|
-
end
|
175
|
-
|