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

Version Path
sproutcore-1.11.0 spec/lib/builders/json_spec.rb
sproutcore-1.11.0.rc3 spec/lib/builders/json_spec.rb
sproutcore-1.11.0.rc2 spec/lib/builders/json_spec.rb
sproutcore-1.11.0.rc1 spec/lib/builders/json_spec.rb
sproutcore-1.10.3.1 spec/lib/builders/json_spec.rb
sproutcore-1.10.2 spec/lib/builders/json_spec.rb
sproutcore-1.10.1 spec/lib/builders/json_spec.rb
sproutcore-1.10.0 spec/lib/builders/json_spec.rb
sproutcore-1.10.0.rc.3 spec/lib/builders/json_spec.rb
sproutcore-1.10.0.rc.2 spec/lib/builders/json_spec.rb
sproutcore-1.10.0.rc.1 spec/lib/builders/json_spec.rb
sproutcore-1.9.2 spec/lib/builders/json_spec.rb
sproutcore-1.9.1 spec/lib/builders/json_spec.rb
sproutcore-1.9.0 spec/lib/builders/json_spec.rb
sproutcore-1.8.2.1 spec/lib/builders/json_spec.rb
sproutcore-1.8.1 spec/lib/builders/json_spec.rb
sproutcore-1.8.0 spec/lib/builders/json_spec.rb