Sha256: 3398a23fef795077383d492d97ff6c1d4ec22688b3f20d5691a4da921027a32e

Contents?: true

Size: 935 Bytes

Versions: 15

Compression:

Stored size: 935 Bytes

Contents

# encoding: utf-8
require 'spec_helper'

describe Actions::ReloadLocalStorage do
  context '#initialize' do
    it 'requires a sinatra app' do
      expect {
        Actions::ReloadLocalStorage.new(sintra_app)
      }
    end
  end

  context '#run' do
    it 'reloads local storage' do
      storage = double('local_storage')

      sintra_app = double('sintra_app')
      expect(sintra_app).to receive(:set).with(:local_storage, storage)

      Actions::ReloadLocalStorage.new(sintra_app, storage).run
    end

    it 'reloads local storage for multiple apps' do
      storage = double('local_storage')

      sintra_app1 = double('sintra_app1')
      expect(sintra_app1).to receive(:set).with(:local_storage, storage)

      sintra_app2 = double('sintra_app2')
      expect(sintra_app2).to receive(:set).with(:local_storage, storage)

      Actions::ReloadLocalStorage.new([sintra_app1, sintra_app2], storage).run
    end
  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
local_pac-0.10.2 spec/actions/reload_repository_spec.rb
local_pac-0.10.1 spec/actions/reload_repository_spec.rb
local_pac-0.10.0 spec/actions/reload_repository_spec.rb
local_pac-0.9.0 spec/actions/reload_repository_spec.rb
local_pac-0.7.0 spec/actions/reload_repository_spec.rb
local_pac-0.6.3 spec/actions/reload_repository_spec.rb
local_pac-0.6.2 spec/actions/reload_repository_spec.rb
local_pac-0.6.1 spec/actions/reload_repository_spec.rb
local_pac-0.5.0 spec/actions/reload_repository_spec.rb
local_pac-0.4.0 spec/actions/reload_repository_spec.rb
local_pac-0.3.0 spec/actions/reload_repository_spec.rb
local_pac-0.2.3 spec/actions/reload_repository_spec.rb
local_pac-0.2.2 spec/actions/reload_repository_spec.rb
local_pac-0.2.1 spec/actions/reload_repository_spec.rb
local_pac-0.2.0 spec/actions/reload_repository_spec.rb