Sha256: 975ae9461bbc30f427441b4fcdf1e2c93440c8896775186a3f459f3af614b50b

Contents?: true

Size: 834 Bytes

Versions: 48

Compression:

Stored size: 834 Bytes

Contents

# encoding:utf-8

require 'spec_helper'

describe WashoutBuilder::Type do
  let(:exception) { WashoutBuilderTestError }
  let(:fault_classes) { [exception] }

  it 'defines a list of types' do
    expect(WashoutBuilder::Type::BASIC_TYPES).to eq(%w(string integer double boolean date datetime float time int))
  end

  it 'gets the fault classes defined' do
    expect(WashoutBuilder::Type.all_fault_classes).to eq([base_exception])
  end

  context 'exception' do
    before(:each) do
      WashoutBuilder::Type.stubs(:all_fault_classes).returns([base_exception])
    end

    it 'checks if exception has ancestor' do
      expect(WashoutBuilder::Type.ancestor_fault?(exception)).to eq(true)
    end

    it 'checks if exception valid' do
      expect(WashoutBuilder::Type.valid_fault_class?(exception)).to eq(true)
    end
  end
end

Version data entries

48 entries across 48 versions & 1 rubygems

Version Path
washout_builder-0.16.4 spec/lib/washout_builder/type_spec.rb
washout_builder-0.16.3 spec/lib/washout_builder/type_spec.rb
washout_builder-0.16.2 spec/lib/washout_builder/type_spec.rb
washout_builder-0.16.1 spec/lib/washout_builder/type_spec.rb
washout_builder-0.16.0 spec/lib/washout_builder/type_spec.rb
washout_builder-0.15.8 spec/lib/washout_builder/type_spec.rb
washout_builder-0.15.7 spec/lib/washout_builder/type_spec.rb
washout_builder-0.15.6 spec/lib/washout_builder/type_spec.rb