Sha256: faa9e78d381289c89af5f55264dd5df319c7fc150f0b6c800f16167989a8001e

Contents?: true

Size: 773 Bytes

Versions: 51

Compression:

Stored size: 773 Bytes

Contents

require_relative "spec_helper"

describe AutoprefixedRails::Railtie do
  before do
    @railtie = AutoprefixedRails::Railtie.instance
  end

  context "with config/autoprefixer.yml" do
    it "works" do
      expect(@railtie.config).to eq(cascade: false, supports: false, env: "test")
    end
  end

  context "with empty config/autoprefixer.yml" do
    before do
      file_path = File.join(Rails.application.root, "config/autoprefixer.yml")
      allow(File).to receive(:exists?).with(file_path) { true }
      allow(::YAML).to receive(:load_file).with(file_path) { false } # empty yaml
    end

    it "skips empty YAML" do
      expect { @railtie.config }.not_to raise_error
    end

    it "works" do
      expect(@railtie.config).to eq(env: "test")
    end
  end
end

Version data entries

51 entries across 36 versions & 2 rubygems

Version Path
zuora_connect_ui-0.9.2 vendor/ruby/2.6.0/gems/autoprefixer-rails-9.6.1.1/spec/railtie_spec.rb
zuora_connect_ui-0.9.2 vendor/ruby/2.6.0/gems/autoprefixer-rails-9.7.1/spec/railtie_spec.rb
autoprefixer-rails-9.7.1 spec/railtie_spec.rb
autoprefixer-rails-9.7.0 spec/railtie_spec.rb
zuora_connect_ui-0.9.1 vendor/ruby/2.6.0/gems/autoprefixer-rails-9.6.4/spec/railtie_spec.rb
zuora_connect_ui-0.9.1 vendor/ruby/2.6.0/gems/autoprefixer-rails-9.6.1.1/spec/railtie_spec.rb
zuora_connect_ui-0.9.1 vendor/ruby/2.6.0/gems/autoprefixer-rails-9.6.1/spec/railtie_spec.rb
zuora_connect_ui-0.9.1 vendor/ruby/2.6.0/gems/autoprefixer-rails-9.6.5/spec/railtie_spec.rb
autoprefixer-rails-9.6.5 spec/railtie_spec.rb
zuora_connect_ui-0.9.0 vendor/ruby/2.6.0/gems/autoprefixer-rails-9.6.1.1/spec/railtie_spec.rb
zuora_connect_ui-0.9.0 vendor/ruby/2.6.0/gems/autoprefixer-rails-9.6.4/spec/railtie_spec.rb
zuora_connect_ui-0.9.0 vendor/ruby/2.6.0/gems/autoprefixer-rails-9.6.1/spec/railtie_spec.rb
autoprefixer-rails-9.6.4 spec/railtie_spec.rb
autoprefixer-rails-9.6.3 spec/railtie_spec.rb
autoprefixer-rails-9.6.2 spec/railtie_spec.rb
zuora_connect_ui-0.8.3 vendor/ruby/2.6.0/gems/autoprefixer-rails-9.6.1.1/spec/railtie_spec.rb
zuora_connect_ui-0.8.3 vendor/ruby/2.6.0/gems/autoprefixer-rails-9.6.1/spec/railtie_spec.rb
autoprefixer-rails-9.6.1.1 spec/railtie_spec.rb
zuora_connect_ui-0.8.2 vendor/ruby/2.6.0/gems/autoprefixer-rails-9.6.1/spec/railtie_spec.rb
zuora_connect_ui-0.8.1 vendor/ruby/2.6.0/gems/autoprefixer-rails-9.6.1/spec/railtie_spec.rb