Sha256: 627ba59fbfdb1975a47e3aefd6f670de4b00ee34f5f42cf516e4342f5c356c04

Contents?: true

Size: 1.25 KB

Versions: 39

Compression:

Stored size: 1.25 KB

Contents

require 'spec_helper'

describe Caracal::Core::FileName do
  let(:file_name) { 'test.docx' }
  
  subject { Caracal::Document.new }
  
  
  #-------------------------------------------------------------
  # Configuration
  #-------------------------------------------------------------

  describe 'configuration tests' do
    
    # constants
    describe 'file name constants' do
      it { expect(subject.class::DEFAULT_FILE_NAME).to eq 'caracal.docx' }
    end
      
    # accessors
    describe 'file name readers' do
      it { expect(subject.name).to eq 'caracal.docx' }
    end
    
  end
  
  
  #-------------------------------------------------------------
  # Public Methods
  #-------------------------------------------------------------

  describe 'public method tests' do
    
    # .file_name
    describe '.file_name' do
      let(:new_name)  { 'example.docx' }
      let(:actual)    { subject.name }
      
      before { subject.file_name(new_name) }
      
      describe 'when argument provided' do
        it { expect(actual).to eq new_name }
      end
      describe 'when argument nil' do
        let!(:previous) { subject.name }
        let(:new_name)  { nil }
        
        it { expect(actual).to eq previous }
      end
    end
    
  end
  
end

Version data entries

39 entries across 39 versions & 2 rubygems

Version Path
caracal_the_curve-1.4.6 spec/lib/caracal/core/file_name_spec.rb
caracal_the_curve-1.4.5 spec/lib/caracal/core/file_name_spec.rb
caracal_the_curve-1.4.4 spec/lib/caracal/core/file_name_spec.rb
caracal_the_curve-1.4.3 spec/lib/caracal/core/file_name_spec.rb
caracal_the_curve-1.4.2 spec/lib/caracal/core/file_name_spec.rb
caracal_the_curve-1.4.1 spec/lib/caracal/core/file_name_spec.rb
caracal-1.4.1 spec/lib/caracal/core/file_name_spec.rb
caracal-1.4.0 spec/lib/caracal/core/file_name_spec.rb
caracal-1.3.0 spec/lib/caracal/core/file_name_spec.rb
caracal-1.2.0 spec/lib/caracal/core/file_name_spec.rb
caracal-1.1.2 spec/lib/caracal/core/file_name_spec.rb
caracal-1.1.1 spec/lib/caracal/core/file_name_spec.rb
caracal-1.1.0 spec/lib/caracal/core/file_name_spec.rb
caracal-1.0.13 spec/lib/caracal/core/file_name_spec.rb
caracal-1.0.12 spec/lib/caracal/core/file_name_spec.rb
caracal-1.0.11 spec/lib/caracal/core/file_name_spec.rb
caracal-1.0.10 spec/lib/caracal/core/file_name_spec.rb
caracal-1.0.9 spec/lib/caracal/core/file_name_spec.rb
caracal-1.0.8 spec/lib/caracal/core/file_name_spec.rb
caracal-1.0.7 spec/lib/caracal/core/file_name_spec.rb