Created
December 28, 2016 18:06
-
-
Save CGA1123/6772774924a9dae6c8187f83e818d339 to your computer and use it in GitHub Desktop.
Revisions
-
CGA1123 created this gist
Dec 28, 2016 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,31 @@ #!/usr/bin/env ruby require 'pathname' # path to your application root. APP_ROOT = Pathname.new File.expand_path('../../', __FILE__) Dir.chdir APP_ROOT do test_env = 'test' puts "Application Environment: #{test_env}" # Resets the test database puts "Setting Up Database..." puts "Drop Database" system "RAILS_ENV=#{test_env} bundle exec rake db:drop" puts "Create Database" system "RAILS_ENV=#{test_env} bundle exec rake db:create" puts "Load Database Schema" system "RAILS_ENV=#{test_env} bundle exec rake db:schema:load" # Run the rspec testing framework # options enabled are: --format documentation puts "\nRun RSpec" puts "$ RAILS_ENV=#{test_env} bundle exec rspec -f d" system "RAILS_ENV=#{test_env} bundle exec rspec -f d" # Run Rubocop # option enabled are: --format fuubar, --display-cop-names, --extra-details puts "\nRun Rubocop" puts "$ bundle exec rubocop -f fu -D -E" system 'bundle exec rubocop -f fu -D -E' end