Sha256: 47f84e85b72cc5442f79d67e1c41a305f1619b1e5baa6027eb5c6abe58d2562c

Contents?: true

Size: 1.62 KB

Versions: 17

Compression:

Stored size: 1.62 KB

Contents

require File.expand_path(File.dirname(__FILE__) + '/../spec_helper')

describe Artii::Base do
  describe '#new' do

    it "should create a new instance" do
      a = Artii::Base.new ''
      a.should be_an_instance_of Artii::Base
    end
  end

  it "font_name should default to 'big.flf'" do
    a = Artii::Base.new 'test'
    a.font_name.should == 'big.flf'
  end

  describe "font switching" do
    context 'should set font if passed -f ' do
      it "should set @font_name" do
        a = Artii::Base.new(:text => 'test', :font => 'chunky')
        a.font_name.should == 'chunky.flf'
      end

      xit "should accept non-flf file formats" do
        a = Artii::Base.new(:text => 'test', :font => 'frango')
        a.font_name.should == 'frango.flc'
      end

      it "should accept fonts in nested directories" do
        a = Artii::Base.new(:text => 'test', :font => 'cour')
        a.font_name.should == 'bdffonts/cour.flf'
      end
    end

    context 'should set font if passed --font' do
      it "set @font_name" do
        a = Artii::Base.new(:text => 'test', :font => 'chunky')
        a.font_name.should == 'chunky.flf'
      end

      it "should accept fonts in nested directories" do
        a = Artii::Base.new(:text => 'test', :font => 'cour')
        a.font_name.should == 'bdffonts/cour.flf'
      end

      xit "should accept non-flf file formats" do
        a = Artii::Base.new 'test', '--font', 'frango'
        a.font_name.should == 'frango.flc'
      end
    end
  end

  describe "#asciify" do
    it "should produce an output" do
      a = Artii::Base.new
      a.asciify('hello world').should_not be_empty
    end
  end
end

Version data entries

17 entries across 17 versions & 3 rubygems

Version Path
lotrd-0.1.9 vendor/cache/ruby/2.6.0/gems/artii-2.1.2/spec/artii/base_spec.rb
lotrd-0.1.8 vendor/cache/ruby/2.6.0/gems/artii-2.1.2/spec/artii/base_spec.rb
lotrd-0.1.6 vendor/cache/ruby/2.6.0/gems/artii-2.1.2/spec/artii/base_spec.rb
lotrd-0.1.5 vendor/cache/ruby/2.6.0/gems/artii-2.1.2/spec/artii/base_spec.rb
pokedex-terminal-0.2.8 vendor/bundle/ruby/2.7.0/gems/artii-2.1.2/spec/artii/base_spec.rb
pokedex-terminal-0.2.7 vendor/bundle/ruby/2.7.0/gems/artii-2.1.2/spec/artii/base_spec.rb
pokedex-terminal-0.2.6 vendor/bundle/ruby/2.7.0/gems/artii-2.1.2/spec/artii/base_spec.rb
pokedex-terminal-0.2.5 vendor/bundle/ruby/2.7.0/gems/artii-2.1.2/spec/artii/base_spec.rb
pokedex-terminal-0.2.4 vendor/bundle/ruby/2.7.0/gems/artii-2.1.2/spec/artii/base_spec.rb
artii-2.1.2 spec/artii/base_spec.rb
artii-2.1.1 spec/artii/base_spec.rb
artii-2.1.0 spec/artii/base_spec.rb
artii-2.0.4 spec/artii/base_spec.rb
artii-2.0.3 spec/artii/base_spec.rb
artii-2.0.2 spec/artii/base_spec.rb
artii-2.0.1 spec/artii/base_spec.rb
artii-2.0.0 spec/artii/base_spec.rb