Sha256: 8db4753b293e622a019be6cdc855be7ee363730a7193badda4a583998213bf0d

Contents?: true

Size: 1.22 KB

Versions: 45

Compression:

Stored size: 1.22 KB

Contents

require "lib/builders/spec_helper"
require 'yaml'

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

45 entries across 45 versions & 1 rubygems

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