Create mocks from active record models without loading rails or running a database.
zeisler on master
v2.6.2 (compare)
zeisler on master
Correct Ruby and Rails versions (compare)
zeisler on rails-6
zeisler on master
Testing for rails 6 (#124) * T… (compare)
zeisler on rails-6
Don't run ruby 2.4 with Rails 5 (compare)
zeisler on rails-6
Adjust Rails 5.0 code to apply … (compare)
zeisler on include_modules
Add forwardable to loaded_mocks… Merge branch 'master' into incl… (compare)
zeisler on rails-6
fix syntax error (compare)
NameError: uninitialized constant ActiveMocker
exception. So I double-checked my Gemfile. I had active_mocker included under the test environment, and not the development environment. Makes sense why dev wasn't understanding. Fixing that and running bundle
fixed both errors, and I'm ready to test! Thanks!
require 'active_record'
Dir[File.dirname(FILE) + "/../lib/api.rb"].each { |file| require file }
Dir[File.dirname(FILE) + "/../models/*.rb"].each { |file| require file }
namespace :active_mocker do
desc('build mocks')
task :build do
task(:environment) do
end
ActiveMocker.configure do |c|
c.single_model_path = ENV['MODEL'] if ENV['MODEL']
c.model_dir = ENV['MODEL_DIR'] if ENV['MODEL_DIR']
c.mock_dir = ENV['MOCK_DIR'] if ENV['MOCK_DIR']
c.progress_bar = false if ENV['MUTE_PROGRESS_BAR']
c.error_verbosity = ENV['ERROR_VERBOSITY'].to_i if ENV['ERROR_VERBOSITY']
c.disable_modules_and_constants = false
end.create_mocks
end
end