Sha256: a88fa01fe22ca09c8ea2fd506cdbd33b831398a669a4885e85af2e0d363963fb

Contents?: true

Size: 912 Bytes

Versions: 5

Compression:

Stored size: 912 Bytes

Contents

require 'spec_helper'

describe Sqed::Result do
  let(:r) {Sqed::Result.new}

  context "attributes are derived from SqedConfig::LAYOUT_SECTION_TYPES" do

    SqedConfig::LAYOUT_SECTION_TYPES.each do |type|
      specify "##{type}" do 
        expect(r.respond_to?(type.to_sym)).to be_truthy 
      end

      specify "##{type}_image" do 
        expect(r.respond_to?("#{type}_image".to_sym)).to be_truthy 
      end

      specify "##{type} initializes to {}" do
        expect(r.send(type.to_sym)).to eq({}) 
      end
    end
  end

  context 'with a new() result' do
    specify '#text_for(section)' do
      expect(r.text_for(:specimen)).to eq(nil)
    end

    specify '#barcode_text_for(section)' do
      expect(r.barcode_text_for(:identifier)).to eq(nil)
    end

    specify '#text' do
      expect(r.text).to eq({})
    end

    specify '#images' do
      expect(r.text).to eq({})
    end
  end

end 

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
sqed-0.1.4 spec/lib/sqed/result_spec.rb
sqed-0.1.3 spec/lib/sqed/result_spec.rb
sqed-0.1.2 spec/lib/sqed/result_spec.rb
sqed-0.1.1 spec/lib/sqed/result_spec.rb
sqed-0.1.0 spec/lib/sqed/result_spec.rb