Sha256: 533921041501ae002df2b7b77dc75a6abcf099804b227df4bd318a06d5dac01d

Contents?: true

Size: 829 Bytes

Versions: 6

Compression:

Stored size: 829 Bytes

Contents

# frozen_string_literal: true

shared_examples_for "roadie cache store" do
  it "allows storing Stylesheets" do
    stylesheet = Roadie::Stylesheet.new("foo.css", "body { color: green; }")
    expect(subject["foo"] = stylesheet).to eql stylesheet
  end

  it "allows retreiving stored stylesheets" do
    stylesheet = Roadie::Stylesheet.new("foo.css", "body { color: green; }")
    subject["foo"] = stylesheet
    stored_stylesheet = subject["foo"]
    expect(stored_stylesheet.to_s).to eq stylesheet.to_s
  end

  it "defaults to nil when cache does not contain path" do
    expect(subject["bar"]).to be_nil
  end

  it "accepts nil assignments to clear cache" do
    subject["foo"] = Roadie::Stylesheet.new("", "")
    expect {
      subject["foo"] = nil
    }.to_not raise_error
    expect(subject["foo"]).to be_nil
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
roadie-5.2.1 lib/roadie/rspec/cache_store.rb
roadie-5.2.0 lib/roadie/rspec/cache_store.rb
roadie-5.1.0 lib/roadie/rspec/cache_store.rb
roadie-5.0.1 lib/roadie/rspec/cache_store.rb
roadie-5.0.0 lib/roadie/rspec/cache_store.rb
roadie-4.0.0 lib/roadie/rspec/cache_store.rb