Sha256: c880f231bba60073f5002baf5cfc5bab5fe1dabd57e70fd6c636d290a5943970

Contents?: true

Size: 843 Bytes

Versions: 2

Compression:

Stored size: 843 Bytes

Contents

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

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

      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

2 entries across 2 versions & 1 rubygems

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