Sha256: 252b91a6c938b957d51614843ee8e997552f4bdd3da7e6974e6862b56849dfb6
Contents?: true
Size: 1.2 KB
Versions: 20
Compression:
Stored size: 1.2 KB
Contents
require File.join(File.dirname(__FILE__), '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 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 & 2 rubygems