spec/spec_helper.rb in new-0.0.14 vs spec/spec_helper.rb in new-0.0.15
- old
+ new
@@ -4,17 +4,16 @@
$: << File.expand_path('../fixtures', __FILE__)
$: << File.expand_path('tasks', New::CUSTOM_DIR)
# See http://rubydoc.info/gems/rspec-core/RSpec/Core/Configuration
RSpec.configure do |config|
- config.treat_symbols_as_metadata_keys_with_true_values = true
config.run_all_when_everything_filtered = true
config.filter_run :focus
config.order = :random
config.before do
- New.stub(:say)
+ allow(New).to receive :say
stub_const 'New::DEFAULT_DIR', root('spec', 'fixtures')
stub_const 'New::CUSTOM_DIR', root('spec', 'fixtures', 'custom')
end
config.before :each do
@@ -32,11 +31,11 @@
end
def new_task task, options = {}
task_class = "New::Task::#{task.to_s.classify}".constantize
- task_class.any_instance.stub(:get_part).and_return(:patch)
- task_class.any_instance.stub(:run)
+ allow_any_instance_of(task_class).to receive(:get_part).and_return(:patch)
+ allow_any_instance_of(task_class).to receive(:run)
task_hash = {}
task_hash[task] = {}
task_options = {
tasks: task_hash