HEX
Server: Apache
System: Windows NT MAGNETO-ARM 10.0 build 22000 (Windows 10) AMD64
User: Michel (0)
PHP: 7.4.7
Disabled: NONE
Upload Files
File: C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/roadie-4.0.0/spec/lib/roadie/css_not_found_spec.rb
# frozen_string_literal: true

require 'spec_helper'

module Roadie
  describe CssNotFound do
    it "is initialized with a name" do
      error = CssNotFound.new('style.css')
      expect(error.css_name).to eq('style.css')
      expect(error.message).to eq('Could not find stylesheet "style.css"')
    end

    it "can be initialized with an extra message" do
      expect(CssNotFound.new('file.css', "directory is missing").message).to eq(
        'Could not find stylesheet "file.css": directory is missing'
      )
    end

    it "shows information about used provider when given" do
      provider = double("Some cool provider")
      expect(CssNotFound.new('style.css', nil, provider).message).to eq(
        %(Could not find stylesheet "style.css"\nUsed provider:\n#{provider})
      )
    end
  end
end