Sha256: a3b427ebccd41371d230b00aa80096636cbbe1f845c2bd134a3569258464ee0f

Contents?: true

Size: 981 Bytes

Versions: 7

Compression:

Stored size: 981 Bytes

Contents

shared_examples_for 'the bootstrap_css helper' do
  it { expect(:bootstrap_css).to link_to_existing_file }
end

shared_examples_for 'the bootstrap_theme_css helper' do
  it { expect(:bootstrap_theme_css).to link_to_existing_file }
end

shared_examples_for 'the bootstrap_js helper' do
  it { expect(:bootstrap_js).to link_to_existing_file }
end

shared_examples_for 'the font_awesome_css helper' do
  it { expect(:font_awesome_css).to link_to_existing_file }
end

#--

RSpec::Matchers.define :link_to_existing_file do
  match do |helper|
    require 'open-uri'
    open_uri_options = {ssl_verify_mode: OpenSSL::SSL::VERIFY_NONE}

    # via HTTP
    open bh.send(helper, scheme: :http), open_uri_options

    # via HTTPS
    open bh.send(helper, scheme: :https), open_uri_options

    # non-minified
    open bh.send(helper, scheme: :http, minified: false), open_uri_options

    # legacy version
    open bh.send(helper, scheme: :http, version: '3.1.0'), open_uri_options
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
bh-1.3.6 spec/shared/cdn_helper.rb
bh-1.3.5 spec/shared/cdn_helper.rb
bh-1.3.4 spec/shared/cdn_helper.rb
bh-1.3.3 spec/shared/cdn_helper.rb
bh-1.3.1 spec/shared/cdn_helper.rb
bh-1.3.0 spec/shared/cdn_helper.rb
bh-1.2.0 spec/shared/cdn_helper.rb