Sha256: d24ad44d99a1462ab8d16266cd2bcd0fe0b9e39b6e201bdf0b708bf96b470904

Contents?: true

Size: 1.25 KB

Versions: 14

Compression:

Stored size: 1.25 KB

Contents

require 'spec_helper'

pwd = File.join(Dir.pwd, "generator_tests")

describe Jax::Generators::LightSource::LightSourceGenerator do
  def generate(*args)
    Jax::Generators::LightSource::LightSourceGenerator.start(args, :shell => shell)
  end
  
  def shell
    @shell ||= SpecShell.new
  end

  before :each do
    FileUtils.rm_rf pwd
    Dir.chdir File.expand_path('..', pwd)
    FileUtils.mkdir_p pwd
    Dir.chdir pwd
    Jax::Generators::App::AppGenerator.start(["test_app"], :shell => shell)
    Dir.chdir File.join(pwd, "test_app")
  end

  after :each do
    FileUtils.rm_rf pwd
    Dir.chdir File.expand_path('..', pwd)
  end

  context "with light name" do
    before(:each) { generate 'torch' }

    it "should generate resource file" do
      File.should exist("app/resources/light_sources/torch.yml")
    end
  end
  
  context "with directional" do
    before(:each) { generate 'torch', 'directional' }
    
    it "should not include position" do
      File.read("app/resources/light_sources/torch.yml").should_not =~ /position/
    end
  end

  context "with point" do
    before(:each) { generate 'torch', 'point' }
    
    it "should not include direction" do
      File.read("app/resources/light_sources/torch.yml").should_not =~ /direction/
    end
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
jax-1.0.1 spec/generators/light_generator_spec.rb
jax-1.0.1.rc2 spec/generators/light_generator_spec.rb
jax-1.0.1.rc1 spec/generators/light_generator_spec.rb
jax-1.0.0 spec/generators/light_generator_spec.rb
jax-0.0.0.10 spec/generators/light_generator_spec.rb
jax-0.0.0.9 spec/generators/light_generator_spec.rb
jax-0.0.0.8 spec/generators/light_generator_spec.rb
jax-0.0.0.7 spec/generators/light_generator_spec.rb
jax-0.0.0.6 spec/generators/light_generator_spec.rb
jax-0.0.0.5 spec/generators/light_generator_spec.rb
jax-0.0.0.4 spec/generators/light_generator_spec.rb
jax-0.0.0.3 spec/generators/light_generator_spec.rb
jax-0.0.0.2 spec/generators/light_generator_spec.rb
jax-0.0.0.1 spec/generators/light_generator_spec.rb