Class: Gemaker::Cmd::ConfigureTestEnv
- Inherits:
-
Base
- Object
- Base
- Gemaker::Cmd::ConfigureTestEnv
show all
- Defined in:
- lib/gemaker/commands/configure_test_env.rb
Instance Method Summary
collapse
Methods inherited from Base
#perform
Methods included from Util
#copy_file, #copy_template, #create_dir, #error, #execute, #execute_in_gem, #gem_root_path, #get_destination_path, #get_template_path, #info, #parse_erb, #remove_in_gem, #utils_path
Instance Method Details
#in_engine_context ⇒ Object
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
|
# File 'lib/gemaker/commands/configure_test_env.rb', line 12
def in_engine_context
copy_template("engine/spec_helper.rb", "spec/spec_helper.rb", config: @config)
copy_template("engine/rails_helper.rb", "spec/rails_helper.rb", config: @config)
copy_template(
"engine/test_example.rb",
"spec/#{@config.gem_name}_spec.rb",
config: @config
)
create_dir("spec/factories")
copy_file("test_helpers.rb", "spec/support/test_helpers.rb")
copy_file("image.png", "spec/fixtures/files/image.png")
copy_file("video.mp4", "spec/fixtures/files/video.mp4")
copy_file("engine/rspec", ".rspec")
copy_file("engine/Guardfile", "Guardfile")
info "Configure Rspec"
end
|
#in_normal_context ⇒ Object
4
5
6
7
8
9
10
|
# File 'lib/gemaker/commands/configure_test_env.rb', line 4
def in_normal_context
copy_template("normal/spec_helper.rb", "spec/spec_helper.rb", config: @config)
copy_file("test_helpers.rb", "spec/support/test_helpers.rb")
copy_template("normal/test_example.rb", "spec/#{@config.gem_name}_spec.rb", config: @config)
copy_file("normal/Guardfile", "Guardfile")
info "Configure Rspec"
end
|