spec/beaker/test_suite_spec.rb in beaker-2.14.1 vs spec/beaker/test_suite_spec.rb in beaker-2.15.0

- old
+ new

@@ -22,9 +22,30 @@ tfs = ts.instance_variable_get(:@test_files) expect(tfs).to include rb_test end + it 'defaults to :slow fail_mode if not provided through parameter or options' do + @files = [ rb_test ] + ts = Beaker::TestSuite.new('name', 'hosts', options, Time.now) + tfm = ts.instance_variable_get(:@fail_mode) + expect(tfm).to be == :slow + end + + it 'uses provided parameter fail_mode' do + @files = [ rb_test ] + ts = Beaker::TestSuite.new('name', 'hosts', options, Time.now, :fast) + tfm = ts.instance_variable_get(:@fail_mode) + expect(tfm).to be == :fast + end + + it 'uses options fail_mode if fail_mode parameter is not provided' do + @files = [ rb_test ] + options[:fail_mode] = :fast + ts = Beaker::TestSuite.new('name', 'hosts', options, Time.now) + tfm = ts.instance_variable_get(:@fail_mode) + expect(tfm).to be == :fast + end end context 'run' do let( :options ) { make_opts.merge({ :logger => double().as_null_object, 'name' => create_files(@files), :log_dated_dir => '.', :xml_dated_dir => '.'}) }