Sha256: 78ba3d19496e7c7cc7ff29b315267fe6e3dc1a8ab3c35ce62ba06db2979716ee

Contents?: true

Size: 1.34 KB

Versions: 20

Compression:

Stored size: 1.34 KB

Contents

require File.join(File.dirname(__FILE__), '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

20 entries across 20 versions & 2 rubygems

Version Path
sproutit-sproutcore-1.0.0.20090407205609 spec/lib/builders/test_index_spec.rb
sproutit-sproutcore-1.0.0.20090408130025 spec/lib/builders/test_index_spec.rb
sproutit-sproutcore-1.0.0.20090416161445 spec/lib/builders/test_index_spec.rb
sproutit-sproutcore-1.0.20090721145236 spec/lib/builders/test_index_spec.rb
sproutcore-1.0.1046 spec/lib/builders/test_index_spec.rb
sproutcore-1.0.1043 spec/lib/builders/test_index_spec.rb
sproutcore-1.0.1042 spec/lib/builders/test_index_spec.rb
sproutcore-1.0.1037 spec/lib/builders/test_index_spec.rb
sproutcore-1.0.1035 spec/lib/builders/test_index_spec.rb
sproutcore-1.0.1031 spec/lib/builders/test_index_spec.rb
sproutcore-1.0.1030 spec/lib/builders/test_index_spec.rb
sproutcore-1.0.1029 spec/lib/builders/test_index_spec.rb
sproutcore-1.0.1027 spec/lib/builders/test_index_spec.rb
sproutcore-1.0.1028 spec/lib/builders/test_index_spec.rb
sproutcore-1.0.1026 spec/lib/builders/test_index_spec.rb
sproutcore-1.0.1025 spec/lib/builders/test_index_spec.rb
sproutcore-1.0.1024 spec/lib/builders/test_index_spec.rb
sproutcore-1.0.1009 spec/lib/builders/test_index_spec.rb
sproutcore-1.0.1008 spec/lib/builders/test_index_spec.rb
sproutcore-1.0.1003 spec/lib/builders/test_index_spec.rb