Sha256: ff58f41657b873b5bbfe4bd2dc004df4e3d2ae57da4a3182a5cf5fbbb9698099
Contents?: true
Size: 1.31 KB
Versions: 17
Compression:
Stored size: 1.31 KB
Contents
require "lib/builders/spec_helper" describe SC::Builder::JSON do include SC::SpecHelpers include SC::BuilderSpecHelper before do std_before :json_test # add fake image entry for sc_static tests.. @manifest.add_entry 'icons/image.png' @target.config.timestamp_urls = false end after do std_after end def run_builder(filename, localize=false) super(filename) do |entry, dst_path| entry[:localized] = true if localize SC::Builder::JSON.build(entry, dst_path) end end it "converts static_url() and sc_static() => 'url('foo')' " do lines = run_builder 'sc_static.json' lines.each do |line| next if line.size == 1 line.should_not =~ /(static_url|sc_static)/ line.should =~ /'.+'/ # important MUST have some url... end end it "static_url() and sc_static() respect timestamp_urls" do @target.config.timestamp_urls = false lines = run_builder 'sc_static.json' lines.each do |line| next if line.size == 1 line.should_not =~ /'.+\?.+'/ # important MUST NOT have some url w/ timestamp... end @target.config.timestamp_urls = true lines = run_builder 'sc_static.json' lines.each do |line| next if line.size == 1 line.should =~ /'.+\?.+'/ # important MUST have some url w/ timestamp... end end end
Version data entries
17 entries across 17 versions & 1 rubygems