Class: Gemaker::Cmd::ConfigureTestEnv

Inherits:
Base
  • Object
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_contextObject



13
14
15
16
17
18
19
20
21
22
23
24
25
26
# File 'lib/gemaker/commands/configure_test_env.rb', line 13

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/dummy/spec/#{@config.gem_name}_spec.rb", config: @config)
  create_dir("spec/dummy/spec/factories")
  copy_file("test_helpers.rb", "spec/dummy/spec/support/test_helpers.rb")
  copy_file("coveralls.yml", ".coveralls.yml")
  copy_file("image.png", "spec/dummy/spec/assets/image.png")
  copy_file("video.mp4", "spec/dummy/spec/assets/video.mp4")
  copy_file("engine/rspec", ".rspec")
  copy_file("engine/Guardfile", "Guardfile")
  info "Configure Rspec"
end

#in_normal_contextObject



4
5
6
7
8
9
10
11
# 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_file("coveralls.yml", ".coveralls.yml")
  copy_template("normal/test_example.rb", "spec/#{@config.gem_name}_spec.rb", config: @config)
  copy_file("normal/Guardfile", "Guardfile")
  info "Configure Rspec"
end