Sha256: 78e2a35a4c791c3499887c57a30c5723dd56ad11b5cbeb34f8051b917a95be00

Contents?: true

Size: 1.42 KB

Versions: 7

Compression:

Stored size: 1.42 KB

Contents

require 'spec_helper'

describe Calatrava::MobileWebApp do
  include Aruba::Api

  before(:each) do
    create_dir 'web'
    create_dir 'web/app/source'
    write_file 'web/app/source/support.coffee', ''

    proj = double('current project', :config => double('cfg', :path => 'env.coffee'))
    Calatrava::Project.stub(:current).and_return(proj)
  end

  let(:manifest) { double('web mf',
                          :coffee_files => ['path/to/kernel.coffee', 'diff/path/shell.coffee'],
                          :haml_files => ['diff/path/shell.haml']) }

  let(:mobile_web) { Calatrava::MobileWebApp.new(current_dir, manifest) }

  it 'should define the correct output directories' do
    mobile_web.build_dir.should match %r{web/public$}
    mobile_web.scripts_build_dir.should match %r{web/public/scripts$}
  end

  context '#coffee_files' do
    subject { mobile_web.coffee_files.collect { |cf| cf.source_file.to_s } }

    it { should include 'path/to/kernel.coffee' }
    it { should include 'diff/path/shell.coffee' }
    it { should include 'web/app/source/support.coffee' }
    it { should include 'env.coffee' }
  end

  context '#scripts' do
    subject { mobile_web.scripts }

    it { should include 'scripts/kernel.js' }
    it { should include 'scripts/shell.js' }
    it { should include 'scripts/support.js' }
  end

  context '#haml_files' do
    subject { mobile_web.haml_files }

    it { should include 'diff/path/shell.haml' }
  end

end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
calatrava-0.6.10 spec/mobile_web_app_spec.rb
calatrava-0.6.9 spec/mobile_web_app_spec.rb
calatrava-0.6.8 spec/mobile_web_app_spec.rb
calatrava-0.6.7 spec/mobile_web_app_spec.rb
calatrava-0.6.6 spec/mobile_web_app_spec.rb
calatrava-0.6.5 spec/mobile_web_app_spec.rb
calatrava-0.6.4 spec/mobile_web_app_spec.rb