Sha256: afcbea0cbf1dfe9b101fb4b03e959ca9626ce26aa77985287fdc42bd7029efd3

Contents?: true

Size: 839 Bytes

Versions: 1

Compression:

Stored size: 839 Bytes

Contents

require_relative '../../../../../test_helper'

module Troo
  module Commands
    describe RefreshAll do
      let(:described_class) { RefreshAll }
      let(:resource) do
        [mock_trello_response('board_200.json', Troo::Remote::Board)]
      end

      before { Retrieval::Remote.stubs(:fetch).returns(resource) }

      describe '.dispatch' do
        subject { described_class.dispatch }

        context 'when all the resources are refreshed' do
          it 'returns a polite message' do
            subject.must_match(/All local data refreshed/)
          end
        end

        context 'when all the resources are not refreshed' do
          let(:resource) { [] }

          it 'returns a polite message' do
            subject.must_match(/Cannot refresh all local data/)
          end
        end
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
troo-0.0.10 test/lib/troo/cli/commands/refresh/all_test.rb