Sha256: 4f8abbd676276a63611b7d5c73d8eb7609d3b8a60c54338eaa63e842295ac08b

Contents?: true

Size: 1.07 KB

Versions: 1

Compression:

Stored size: 1.07 KB

Contents

require "spec_helper"
require "netatalk-config"

describe NetatalkConfig do
  before { NetatalkConfig.clear }

  context 'no shares' do
    its('afp') { should match(/\A\s*\z/) }
  end

  shared_context 'simple share' do
    before do
      subject.shares['simple'] = {
        'path' => '/simple/path'
      }
    end
  end

  shared_context 'advanced share' do
    before do
      subject.shares['advanced'] = {
        'path' => '/advanced/path',
        'time_machine' => true
      }
    end
  end

  context 'simple share' do
    include_context 'simple share'
    its('afp') { should include("[simple]\n  path = /simple/path") }
  end

  context 'advanced shares' do
    include_context 'advanced share'
    its('afp') { should include("[advanced]\n  path = /advanced/path\n  time machine = yes") }
  end

  context 'simple + advanced shares' do
    include_context 'simple share'
    include_context 'advanced share'
    its('afp') { should include("[simple]\n  path = /simple/path") }
    its('afp') { should include("[advanced]\n  path = /advanced/path\n  time machine = yes") }
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
netatalk-config-0.0.2 spec/lib/netatalk-config_spec.rb