Sha256: f79e1e7f58ae9182be6a299d96de95886841604f2e83caa13c5259ee528cfa86

Contents?: true

Size: 818 Bytes

Versions: 4

Compression:

Stored size: 818 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
    WashoutBuilder::Type::BASIC_TYPES.should eq(%w(string integer double boolean date datetime float time int))
  end

  it 'gets the fault classes defined' do
    WashoutBuilder::Type.all_fault_classes.should 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
      WashoutBuilder::Type.ancestor_fault?(exception).should eq(true)
    end

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

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
washout_builder-0.15.4 spec/lib/washout_builder/type_spec.rb
washout_builder-0.15.3 spec/lib/washout_builder/type_spec.rb
washout_builder-0.15.1 spec/lib/washout_builder/type_spec.rb
washout_builder-0.15.0 spec/lib/washout_builder/type_spec.rb