Sha256: 91536533448b7c5fd014d032620309adc49df38740f3973356540740806ac146

Contents?: true

Size: 999 Bytes

Versions: 3

Compression:

Stored size: 999 Bytes

Contents

# coding: utf-8

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

describe 'Retter::Command#list', clean: :all do
  let(:command) { Retter::Command.new }
  let(:wip_file) { retter_config.wip_file }

  before do
    Retter.stub!(:config) { retter_config }
  end

  context 'happy case' do
    before do
      retter_config.retter_file(Date.parse('20110101')).open('w') do |f|
        f.puts <<-EOM
# 朝11時

おはようございます

# 夜1時

おやすみなさい
        EOM
      end

      retter_config.retter_file(Date.parse('20110222')).open('w') do |f|
        f.puts <<-EOM
# 朝11時30分

おはようございます

# 夜1時30分

おやすみなさい
        EOM
      end
    end

    subject { capture(:stdout) { command.list }.split(/\n+/) }

    its([0]) { should match /\[e0\]\s+2011\-02\-22/ }
    its([1]) { should match /朝11時30分, 夜1時30分/ }
    its([2]) { should match /\[e1\]\s+2011\-01\-01/ }
    its([3]) { should match /朝11時, 夜1時/ }
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
retter-0.1.3 spec/command/list_spec.rb
retter-0.1.2 spec/command/list_spec.rb
retter-0.1.1 spec/command/list_spec.rb