spec/rake/funnel/tasks/nunit_spec.rb in rake-funnel-0.18.0 vs spec/rake/funnel/tasks/nunit_spec.rb in rake-funnel-0.19.0

- old
+ new

@@ -1,14 +1,16 @@ +# rubocop:disable RSpec/FilePath + include Rake include Rake::Funnel include Rake::Funnel::Integration::TeamCity include Rake::Funnel::Support describe Rake::Funnel::Tasks::NUnit do - before { + before do Task.clear - } + end describe 'defaults' do its(:name) { should == :test } its(:args) { should == {} } its(:nunit) { should == 'nunit-console.exe' } @@ -16,28 +18,28 @@ end describe 'execution' do let(:args) { {} } - let(:mapper) { double(Mapper).as_null_object } - let(:finder) { double(Finder).as_null_object } + let(:mapper) { instance_double(Mapper).as_null_object } + let(:finder) { instance_double(Finder).as_null_object } - before { + before do allow(subject).to receive(:sh) allow(Mapper).to receive(:new).and_return(mapper) allow(Finder).to receive(:new).and_return(finder) allow(NUnitPlugin).to receive(:setup) allow(Mono).to receive(:invocation).and_wrap_original do |_original_method, *args, &_block| args.compact end - } + end - before { + before do Task[subject.name].invoke - } + end it 'should use test assembly finder' do expect(finder).to have_received(:all) end @@ -60,14 +62,14 @@ it 'should run with sh' do expect(subject).to have_received(:sh) end context 'with custom NUnit executable' do - subject { + subject do described_class.new do |t| t.nunit = 'custom nunit.exe' end - } + end its(:nunit) { should == 'custom nunit.exe' } end end end