Sha256: 83c074879f8256c7cde1b5dbd2d99fde7451347e9fd082660a0776626d2663b1

Contents?: true

Size: 1.2 KB

Versions: 20

Compression:

Stored size: 1.2 KB

Contents

require "lib/builders/spec_helper"

describe SC::Builder::Strings do

  include SC::SpecHelpers
  include SC::BuilderSpecHelper

  before do
    std_before :strings_test

    # add fake strings entry
    @source_entry = @manifest.add_entry 'lproj/strings.js',
      :build_task => 'build:copy'

    @entry = @manifest.add_transform @source_entry,
      :ext => 'yaml',
      :entry_type => :yaml,
      :build_task => 'build:strings'

  end


  after do
    std_after
  end

  # Note, the string.js fixture file this test loads should stress the
  # builder to make sure it can parse various cases.
  it "generates a yaml file with contents of string.js parsed into a hash" do
    pending "what is this YAML file used for?"

    dst_path = @entry.staging_path
    SC::Builder::Strings.build(@entry, dst_path)
    File.exist?(dst_path).should be_true

    # get YAML
    require 'yaml'
    yaml = YAML.load(File.read(dst_path))
    yaml.should_not be_nil

    expected = {
      'test1' => "test1",
      'test2' => 'test2 "with quotes"',
      'test3' => "test3",
      "test4" => 'test4'
    }
    yaml.keys.size.should == expected.keys.size
    expected.each do |key, value|
      yaml[key].should == value
    end
  end

end


Version data entries

20 entries across 20 versions & 1 rubygems

Version Path
sproutcore-1.4.5 spec/lib/builders/strings_spec.rb
sproutcore-1.4.5-java spec/lib/builders/strings_spec.rb
sproutcore-1.4.4-java spec/lib/builders/strings_spec.rb
sproutcore-1.4.4 spec/lib/builders/strings_spec.rb
sproutcore-1.4.3.1 spec/lib/builders/strings_spec.rb
sproutcore-1.4.3-java spec/lib/builders/strings_spec.rb
sproutcore-1.4.3 spec/lib/builders/strings_spec.rb
sproutcore-1.4.2-java spec/lib/builders/strings_spec.rb
sproutcore-1.4.2 spec/lib/builders/strings_spec.rb
sproutcore-1.4.1-java spec/lib/builders/strings_spec.rb
sproutcore-1.4.1 spec/lib/builders/strings_spec.rb
sproutcore-1.4.0-java spec/lib/builders/strings_spec.rb
sproutcore-1.4.0 spec/lib/builders/strings_spec.rb
sproutcore-1.4.0.rc.5 spec/lib/builders/strings_spec.rb
sproutcore-1.4.0.rc.4 spec/lib/builders/strings_spec.rb
sproutcore-1.4.0.rc.3 spec/lib/builders/strings_spec.rb
sproutcore-1.4.0.rc.2 spec/lib/builders/strings_spec.rb
sproutcore-1.4.0.rc spec/lib/builders/strings_spec.rb
sproutcore-1.0.1049.pre.2 spec/lib/builders/strings_spec.rb
sproutcore-1.0.1049.pre.1 spec/lib/builders/strings_spec.rb