Sha256: a8abd13c0c053e7c0a8e73a518f1cb6190ffd3598381448f18ab94e4a9a3be17

Contents?: true

Size: 617 Bytes

Versions: 4

Compression:

Stored size: 617 Bytes

Contents

require 'spec_helper'

describe Daigaku::Terminal do
  it { is_expected.to respond_to :text }

  describe '.text' do
    it 'loads a text from a file in the terminal/texts' do
      text = Daigaku::Terminal.text(:welcome)
      expect(text).to be_a String
    end

    it 'returns an empty string if the file does not exist' do
      text = Daigaku::Terminal.text(:non_existent_text)
      expect(text).to eq ''
    end

    it 'returns an empty string if the file has no content' do
      allow(File).to receive(:read).and_return('')
      expect(Daigaku::Terminal.text(:congratulations)).to eq ''
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
daigaku-1.0.0 spec/daigaku/terminal_spec.rb
daigaku-0.6.0 spec/daigaku/terminal_spec.rb
daigaku-0.5.0 spec/daigaku/terminal_spec.rb
daigaku-0.4.0 spec/daigaku/terminal_spec.rb