Sha256: 17559ca0a65a7f046b0ac1c709348ff1c2ed5fac7e96ec428e543d7a5e5b30ed

Contents?: true

Size: 1.3 KB

Versions: 65

Compression:

Stored size: 1.3 KB

Contents

require "lib/builders/spec_helper"

describe SC::Builder::Test do

  include SC::SpecHelpers
  include SC::BuilderSpecHelper

  before do
    std_before :test_test

    # run std rules to run manifest.  Then verify preconditions to make sure
    # no other changes to the build system effect the ability of these tests
    # to run properly.
    @manifest.build!
    @qunit_entry = @manifest.entry_for('tests/qunit_test.html')
    @rhtml_entry   = @manifest.entry_for('tests/rhtml_test.html')
    @index_entry = @manifest.entry_for('tests/-index.json')
  end

  after do
    std_after
  end

  it "VERIFY PRECONDITIONS" do
    # Verify qunit entry -- should have qunit_test.js entry
    @index_entry.should_not be_nil
  end

  it "should generate json with entries for both qunit & rhtml entry" do
    dst_path = @index_entry.build_path
    SC::Builder::TestIndex.build(@index_entry, dst_path)

    require 'json'
    File.exist?(dst_path).should be_true
    result = JSON.parse(File.read(dst_path))
    result.size.should == 3 #qunit_test, rhtml_test, qunit_test2
    result.each do |item|
      next if item['filename'] =~ /qunit_test2/
      entry = (item['filename'] =~ /qunit_test/) ? @qunit_entry : @rhtml_entry
      item['filename'].should == entry.filename.ext('')
      item['url'].should == entry.url
    end
  end

end

Version data entries

65 entries across 65 versions & 1 rubygems

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