Sha256: 3c876eaefca3722799bd4beaab9c548938904eac42e72b878630132d0362cf90
Contents?: true
Size: 1.01 KB
Versions: 41
Compression:
Stored size: 1.01 KB
Contents
require_relative '../lib/inline_svg/finds_asset_paths' require_relative '../lib/inline_svg/asset_file' describe InlineSvg::AssetFile do it "reads data from a file, after qualifying a full path" do example_svg_path = File.expand_path(__FILE__, 'files/example.svg') expect(InlineSvg::FindsAssetPaths).to receive(:by_filename).with('some filename').and_return example_svg_path expect(InlineSvg::AssetFile.named('some filename')).to include('This is a test') end it "complains when the file cannot be read" do allow(InlineSvg::FindsAssetPaths).to receive(:by_filename).and_return('/this/path/does/not/exist') expect do InlineSvg::AssetFile.named('some missing file') end.to raise_error InlineSvg::AssetFile::FileNotFound end it "complains when the file path was not found" do allow(InlineSvg::FindsAssetPaths).to receive(:by_filename).and_return(nil) expect do InlineSvg::AssetFile.named('some missing file') end.to raise_error InlineSvg::AssetFile::FileNotFound end end
Version data entries
41 entries across 41 versions & 2 rubygems
Version | Path |
---|---|
inline_svg-0.3.0 | spec/asset_file_spec.rb |