File: errors_spec.rb

package info (click to toggle)
ruby-buff-ignore 1.2.0-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 164 kB
  • sloc: ruby: 183; makefile: 3
file content (26 lines) | stat: -rw-r--r-- 576 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
require 'spec_helper'

describe Buff::Ignore::BuffIgnoreError do
  it 'inherits from StandardError' do
    expect(subject).to be_a(StandardError)
  end
end

describe Buff::Ignore::IgnoreFileNotFound do
  let(:path) { '/path/to/file' }
  subject { described_class.new(path) }

  it 'accepts a filepath as the parameter' do
    expect {
      described_class.new(path)
    }.to_not raise_error
  end

  context 'when path is nil' do
    let(:path) { nil }

    it 'has the correct message' do
      expect(subject.message).to eq("No ignore file found at ''!")
    end
  end
end