spec/rake/funnel/tasks/environments_spec.rb in rake-funnel-0.21.0 vs spec/rake/funnel/tasks/environments_spec.rb in rake-funnel-0.21.1
- old
+ new
@@ -1,16 +1,12 @@
require 'configatron'
-include Rake
-include Rake::Funnel::Support::Environments
-include Rake::Funnel::Tasks
-
describe Rake::Funnel::Tasks::Environments do
include Rake::DSL
before do
- Task.clear
+ Rake::Task.clear
end
let(:files) { [] }
before do
@@ -88,11 +84,11 @@
let(:files) do
%w(config/dev.yaml)
end
before do
- allow(Loader).to receive(:load_configuration)
+ allow(Rake::Funnel::Support::Environments::Loader).to receive(:load_configuration)
end
before do
allow(File).to receive(:exist?).and_return(true)
allow(File).to receive(:exist?).with(optional).and_return(false)
@@ -103,42 +99,43 @@
t.default_env = 'dev'
end
end
before do
- Task['dev'].invoke
+ Rake::Task['dev'].invoke
end
it 'should store configuration in configatron singleton' do
- expect(Loader).to have_received(:load_configuration).with(anything, configatron, any_args)
+ expect(Rake::Funnel::Support::Environments::Loader).to \
+ have_received(:load_configuration).with(anything, configatron, any_args)
end
context 'default and local config files exist' do
let(:optional) { nil }
it 'should load all files' do
- expect(Loader)
+ expect(Rake::Funnel::Support::Environments::Loader)
.to have_received(:load_configuration)
.with(hash_including(config_files: %w(config/default.yaml config/dev.yaml config/local.yaml)), any_args)
end
end
context 'default config file does not exist' do
let(:optional) { 'config/default.yaml' }
it 'should load environment file and local file' do
- expect(Loader)
+ expect(Rake::Funnel::Support::Environments::Loader)
.to have_received(:load_configuration)
.with(hash_including(config_files: %w(config/dev.yaml config/local.yaml)), any_args)
end
end
context 'local config file does not exist' do
let(:optional) { 'config/local.yaml' }
it 'should load default file and environment file' do
- expect(Loader).to \
+ expect(Rake::Funnel::Support::Environments::Loader).to \
have_received(:load_configuration)
.with(hash_including(config_files: %w(config/default.yaml config/dev.yaml)),
any_args)
end
end
@@ -155,18 +152,19 @@
t.customizer = customizer
end
end
before do
- allow(Loader).to receive(:load_configuration)
+ allow(Rake::Funnel::Support::Environments::Loader).to receive(:load_configuration)
end
before do
- Task['dev'].invoke
+ Rake::Task['dev'].invoke
end
it 'should pass customizer to loader' do
- expect(Loader).to have_received(:load_configuration).with(anything, anything, customizer)
+ expect(Rake::Funnel::Support::Environments::Loader).to \
+ have_received(:load_configuration).with(anything, anything, customizer)
end
end
describe 'automatic environment setup' do
let(:files) do