Sha256: eb096d65299520093999368dc0c9e5cdaf9c988662d48213e273e569d0b90bbe

Contents?: true

Size: 897 Bytes

Versions: 7

Compression:

Stored size: 897 Bytes

Contents

# frozen_string_literal: true

require "spec_helper"

module Roadie
  describe CssNotFound do
    it "is initialized with a name" do
      error = CssNotFound.new(css_name: "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
      error = CssNotFound.new(css_name: "file.css", message: "directory is missing")
      expect(error.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")
      error = CssNotFound.new(css_name: "style.css", provider: provider)

      expect(error.message).to eq(
        %(Could not find stylesheet "style.css"\nUsed provider:\n#{provider})
      )
    end
  end
end

Version data entries

7 entries across 6 versions & 2 rubygems

Version Path
trusty-cms-7.0.9.1 vendor/bundle/ruby/3.1.0/gems/roadie-5.2.1/spec/lib/roadie/css_not_found_spec.rb
trusty-cms-7.0.9.1 vendor/bundle/ruby/3.3.0/gems/roadie-5.2.1/spec/lib/roadie/css_not_found_spec.rb
roadie-5.2.1 spec/lib/roadie/css_not_found_spec.rb
roadie-5.2.0 spec/lib/roadie/css_not_found_spec.rb
roadie-5.1.0 spec/lib/roadie/css_not_found_spec.rb
roadie-5.0.1 spec/lib/roadie/css_not_found_spec.rb
roadie-5.0.0 spec/lib/roadie/css_not_found_spec.rb