Sha256: 950d0803626a21b2ae914eb9c085e9d4872ab001518cba7eb824db9ddb889840

Contents?: true

Size: 915 Bytes

Versions: 6

Compression:

Stored size: 915 Bytes

Contents

require 'cucumber/html_formatter/assets_loader'

describe Cucumber::HTMLFormatter::AssetsLoader do
  let(:subject) { Cucumber::HTMLFormatter::AssetsLoader.new }

  before do
    allow(File).to receive(:read).and_return('whatever content')
  end

  context '.template' do
    it 'reads the content of assets/index.mustache.html' do
      expect(subject.template).to eq('whatever content')
      expect(File).to have_received(:read).with(/.*\/assets\/index\.mustache\.html$/)
    end
  end

  context '.css' do
    it 'reads the content of assets/main.css' do
      expect(subject.css).to eq('whatever content')
      expect(File).to have_received(:read).with(/.*\/assets\/main\.css$/)
    end
  end

  context '.script' do
    it 'reads the content of assets/main.js' do
      expect(subject.script).to eq('whatever content')
      expect(File).to have_received(:read).with(/.*\/assets\/main\.js$/)
    end
  end
end

Version data entries

6 entries across 6 versions & 2 rubygems

Version Path
honeybadger-5.4.0 vendor/bundle/ruby/3.2.0/gems/cucumber-html-formatter-20.4.0/spec/html-formatter/assets_loader_spec.rb
cucumber-html-formatter-21.0.0 spec/html-formatter/assets_loader_spec.rb
honeybadger-5.3.0 vendor/bundle/ruby/3.2.0/gems/cucumber-html-formatter-20.4.0/spec/html-formatter/assets_loader_spec.rb
cucumber-html-formatter-20.4.0 spec/html-formatter/assets_loader_spec.rb
cucumber-html-formatter-20.3.1 spec/html-formatter/assets_loader_spec.rb
cucumber-html-formatter-20.3.0 spec/html-formatter/assets_loader_spec.rb