Sha256: dea6945beb80b05e927b017106021219e55752cd058f2f3505f3168bd099ced7

Contents?: true

Size: 1009 Bytes

Versions: 4

Compression:

Stored size: 1009 Bytes

Contents

require File.expand_path('helper', File.dirname(__FILE__))

class TestDataMinerVerify < Test::Unit::TestCase
  context '#run' do
    should 'raise an exception if the verification block fails through exception' do
      raising_check = lambda { raise "boom" }
      verify = DataMiner::Verify.new Aircraft.data_miner_config, 'verification of engine type', &raising_check
      assert_raise(DataMiner::VerificationFailed) { verify.run }
    end
    should 'raise an exception if the result of the verification block is false' do
      failing_check = lambda { false }
      verify = DataMiner::Verify.new Aircraft.data_miner_config, 'verification of engine type', &failing_check
      assert_raise(DataMiner::VerificationFailed) { verify.run }
    end
    should 'return true if the verification block succeeds' do
      passing_check = lambda { true }
      verify = DataMiner::Verify.new Aircraft.data_miner_config, 'verification of engine type', &passing_check
      assert_nil verify.run
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
data_miner-1.2.4 test/test_data_miner_verify.rb
data_miner-1.2.3 test/test_data_miner_verify.rb
data_miner-1.2.2 test/test_data_miner_verify.rb
data_miner-1.2.1 test/test_data_miner_verify.rb