epall-limelight 0.5.1-java → 0.5.2-java

Sign up to get free protection for your applications and to get access to all the features.
Files changed (50) hide show
  1. data/lib/init.rb +2 -6
  2. data/lib/limelight.jar +0 -0
  3. data/lib/limelight/builtin/utilities_production/alert/players/alert.rb +4 -1
  4. data/lib/limelight/builtin/utilities_production/production.rb +6 -2
  5. data/lib/limelight/commands/create_command.rb +1 -1
  6. data/lib/limelight/commands/open_command.rb +4 -4
  7. data/lib/limelight/dsl/styles_builder.rb +5 -0
  8. data/lib/limelight/java_couplings.rb +3 -2
  9. data/lib/limelight/limelight_init.rb +12 -0
  10. data/lib/limelight/main.rb +43 -46
  11. data/lib/limelight/producer.rb +54 -13
  12. data/lib/limelight/production.rb +34 -7
  13. data/lib/limelight/scene.rb +1 -1
  14. data/lib/limelight/specs/spec_helper.rb +1 -1
  15. data/lib/limelight/specs/test_scene_opener.rb +3 -0
  16. data/lib/limelight/stage.rb +65 -5
  17. data/lib/limelight/studio.rb +28 -159
  18. data/lib/limelight/styles/style.rb +288 -0
  19. data/lib/limelight/theater.rb +27 -2
  20. data/lib/limelight/version.rb +2 -2
  21. data/productions/examples/sandbox/alerts/players/alerts.rb +1 -1
  22. data/productions/examples/sandbox/stage_handles/players/sizer.rb +3 -0
  23. data/spec/limelight/builtin/players/combo_box_spec.rb +1 -1
  24. data/spec/limelight/builtin/players/radio_button_spec.rb +1 -1
  25. data/spec/limelight/builtin/utilities_production/utilities_production_spec.rb +39 -38
  26. data/spec/limelight/casting_director_spec.rb +1 -1
  27. data/spec/limelight/commands/create_command_spec.rb +4 -4
  28. data/spec/limelight/commands/open_command_spec.rb +5 -4
  29. data/spec/limelight/commands/pack_command_spec.rb +1 -1
  30. data/spec/limelight/commands/unpack_command_spec.rb +1 -1
  31. data/spec/limelight/dsl/prop_builder_spec.rb +6 -6
  32. data/spec/limelight/dsl/stage_builder_spec.rb +1 -1
  33. data/spec/limelight/file_chooser_spec.rb +1 -1
  34. data/spec/limelight/file_filter_spec.rb +2 -2
  35. data/spec/limelight/main_spec.rb +2 -2
  36. data/spec/limelight/paint_action_spec.rb +1 -1
  37. data/spec/limelight/pen_spec.rb +1 -1
  38. data/spec/limelight/producer_spec.rb +30 -11
  39. data/spec/limelight/production_spec.rb +12 -20
  40. data/spec/limelight/prop_spec.rb +2 -2
  41. data/spec/limelight/scene_spec.rb +1 -1
  42. data/spec/limelight/stage_spec.rb +51 -6
  43. data/spec/limelight/templates/templater_spec.rb +1 -1
  44. data/spec/limelight/theater_spec.rb +49 -1
  45. data/spec/spec_helper.rb +0 -6
  46. metadata +5 -7
  47. data/lib/limelight/client/playbills.rb +0 -86
  48. data/lib/limelight/styles.rb +0 -347
  49. data/spec/limelight/client/playbills_spec.rb +0 -79
  50. data/spec/limelight/studio_spec.rb +0 -157
@@ -15,7 +15,8 @@ module Limelight
15
15
  #
16
16
  attr_reader :active_stage
17
17
 
18
- def initialize
18
+ def initialize(production)
19
+ @production = production
19
20
  @stages = {}
20
21
  end
21
22
 
@@ -46,17 +47,27 @@ module Limelight
46
47
  return stage
47
48
  end
48
49
 
49
- # Lets the Theater know which stage has the limelight (currently active).
50
+ # Invoked when a stage, blonging to this theater becomes active. Lets the Theater know which stage
51
+ # has the limelight (currently active). Only 1 stage may be active at a time.
50
52
  #
51
53
  def stage_activated(stage)
52
54
  @active_stage = stage
53
55
  end
54
56
 
57
+ # Invoked when a stage, belonging to this theater, loose it's status as the active stage. The active_stage is
58
+ # cleared. Only 1 stage may be active at a time.
59
+ #
60
+ def stage_deactivated(stage)
61
+ @active_stage = nil
62
+ @production.theater_empty! if !any_visible_stages?
63
+ end
64
+
55
65
  # Removes the stage from this theater.
56
66
  #
57
67
  def stage_closed(stage)
58
68
  @stages.delete(stage.name)
59
69
  @active_stage = nil if @active_stage == stage
70
+ @production.theater_empty! if @stages.empty? || !any_visible_stages?
60
71
  end
61
72
 
62
73
  # If no Stages are added, the Theater will provide a default Stage named "Limelight".
@@ -66,11 +77,25 @@ module Limelight
66
77
  return self["Limelight"]
67
78
  end
68
79
 
80
+ # Close this theater. All stages in this theater will be closed and the active_stage will be nil'ed.
81
+ #
82
+ def close
83
+ @stages.values.each { |stage| stage.close }
84
+ @stages.clear
85
+ @active_stage = nil
86
+ end
87
+
69
88
  protected #############################################
70
89
 
71
90
  def build_stage(name, options)
72
91
  return Limelight::Stage.new(self, name, options)
73
92
  end
93
+
94
+ private ###############################################
95
+
96
+ def any_visible_stages?
97
+ return @stages.values.any? { |s| s.visible? }
98
+ end
74
99
 
75
100
  end
76
101
 
@@ -6,7 +6,7 @@ module Limelight
6
6
  unless defined? MAJOR
7
7
  MAJOR = 0
8
8
  MINOR = 5
9
- TINY = 1
9
+ TINY = 2
10
10
 
11
11
  STRING = [MAJOR, MINOR, TINY].join('.')
12
12
  TAG = "REL_" + [MAJOR, MINOR, TINY].join('_')
@@ -17,4 +17,4 @@ module Limelight
17
17
  DESCRIPTION = "#{NAME}-#{STRING} - Limelight\n#{URL}"
18
18
  end
19
19
  end
20
- end
20
+ end
@@ -11,7 +11,7 @@ module Alerts
11
11
 
12
12
  def open_incompatible_production
13
13
  production_path = File.join(path, "incompatible_production")
14
- Thread.new { Limelight::Studio.open(production_path) }
14
+ Thread.new { Limelight::Context.instance.studio.open(production_path) }
15
15
  end
16
16
 
17
17
  end
@@ -1,3 +1,6 @@
1
+ #- Copyright � 2008-2009 8th Light, Inc. All Rights Reserved.
2
+ #- Limelight and all included source files are distributed under terms of the GNU LGPL.
3
+
1
4
  module Sizer
2
5
 
3
6
  def casted
@@ -9,7 +9,7 @@ require 'limelight/builtin/players/combo_box'
9
9
  describe Limelight::Builtin::Players::ComboBox do
10
10
 
11
11
  before(:each) do
12
- @scene = Limelight::Scene.new(:casting_director => make_mock("caster", :fill_cast => nil))
12
+ @scene = Limelight::Scene.new(:casting_director => mock("caster", :fill_cast => nil))
13
13
  @prop = Limelight::Prop.new(:scene => @scene)
14
14
  @prop.include_player(Limelight::Builtin::Players::ComboBox)
15
15
  end
@@ -9,7 +9,7 @@ require 'limelight/builtin/players/radio_button'
9
9
  describe Limelight::Builtin::Players::RadioButton do
10
10
 
11
11
  before(:each) do
12
- @scene = Limelight::Scene.new(:casting_director => make_mock("caster", :fill_cast => nil))
12
+ @scene = Limelight::Scene.new(:casting_director => mock("caster", :fill_cast => nil))
13
13
  @prop = Limelight::Prop.new
14
14
  @scene << @prop
15
15
  @prop.include_player(Limelight::Builtin::Players::RadioButton)
@@ -5,9 +5,10 @@ require File.expand_path(File.dirname(__FILE__) + "/spec_helper")
5
5
 
6
6
  describe "Utilitites Production" do
7
7
 
8
- uses_scene "none"
8
+ uses_limelight
9
9
 
10
10
  before(:each) do
11
+ @result = nil
11
12
  production.production_opening
12
13
  end
13
14
 
@@ -17,8 +18,43 @@ describe "Utilitites Production" do
17
18
  end
18
19
 
19
20
  after(:all) do
20
- # Java::java.awt.Frame.getFrames.each { |frame| frame.close; frame.dispose; puts frame }
21
- # Java::limelight.util.Threads.showAll
21
+ # Java::java.awt.Frame.getFrames.each { |frame| frame.close; frame.dispose; puts frame }
22
+ # Java::limelight.util.Threads.showAll
23
+ end
24
+
25
+ def start_alert()
26
+ @thread = Thread.new do
27
+ begin
28
+ @result = production.alert("Some Message")
29
+ rescue Exception => e
30
+ puts e
31
+ puts e.backtrace
32
+ end
33
+ end
34
+ end
35
+
36
+ def start_proceed_with_incompatible_version()
37
+ @thread = Thread.new do
38
+ begin
39
+ @result = production.proceed_with_incompatible_version?("Some Production", "1.2.3")
40
+ rescue Exception => e
41
+ puts e
42
+ puts e.backtrace
43
+ end
44
+ end
45
+ end
46
+
47
+ def wait_for
48
+ 10.times do
49
+ return if yield
50
+ sleep(0.1)
51
+ end
52
+ raise "the desired condition was not met on time"
53
+ end
54
+
55
+ def scene_open?(stage_name)
56
+ stage = production.theater[stage_name]
57
+ return stage != nil && stage.current_scene != nil
22
58
  end
23
59
 
24
60
  it "should construct stage on load_with_incomptible_version_scene" do
@@ -51,30 +87,6 @@ describe "Utilitites Production" do
51
87
  scene.find("current_version_label").text.should == Limelight::VERSION::STRING
52
88
  end
53
89
 
54
- def start_proceed_with_incompatible_version()
55
- @thread = Thread.new do
56
- begin
57
- @result = production.proceed_with_incompatible_version?("Some Production", "1.2.3")
58
- rescue Exception => e
59
- puts e
60
- puts e.backtrace
61
- end
62
- end
63
- end
64
-
65
- def wait_for
66
- 10.times do
67
- return if yield
68
- sleep(0.1)
69
- end
70
- raise "the desired condition was not met on time"
71
- end
72
-
73
- def scene_open?(stage_name)
74
- stage = production.theater[stage_name]
75
- return stage != nil && stage.current_scene != nil
76
- end
77
-
78
90
  it "should return true when clicking proceed" do
79
91
  @result = nil
80
92
  start_proceed_with_incompatible_version()
@@ -99,17 +111,6 @@ describe "Utilitites Production" do
99
111
  @result.should == false
100
112
  end
101
113
 
102
- def start_alert()
103
- @thread = Thread.new do
104
- begin
105
- @result = production.alert("Some Message")
106
- rescue Exception => e
107
- puts e
108
- puts e.backtrace
109
- end
110
- end
111
- end
112
-
113
114
  it "should construct alert stage" do
114
115
  production.load_alert_scene("Some Message")
115
116
  stage = production.theater["Alert"]
@@ -13,7 +13,7 @@ describe Limelight::CastingDirector do
13
13
  TestDir.clean
14
14
  $casted_props = []
15
15
  $casted_players = []
16
- @scene = Limelight::Scene.new(:casting_director => make_mock("casting_director", :fill_cast => nil), :path => TestDir.path("scene_path"))
16
+ @scene = Limelight::Scene.new(:casting_director => mock("casting_director", :fill_cast => nil), :path => TestDir.path("scene_path"))
17
17
  @scene.illuminate
18
18
  @loader = Limelight::FileLoader.for_root(TestDir.root)
19
19
  @casting_director = Limelight::CastingDirector.new(@loader)
@@ -23,9 +23,9 @@ describe Limelight::Commands::CreateCommand do
23
23
  end
24
24
 
25
25
  it "should create a production" do
26
- production_templater = make_mock("production_templater")
26
+ production_templater = mock("production_templater")
27
27
  Limelight::Templates::ProductionTemplater.should_receive(:new).and_return(production_templater)
28
- scene_templater = make_mock("scene_templater")
28
+ scene_templater = mock("scene_templater")
29
29
  Limelight::Templates::SceneTemplater.should_receive(:new).and_return(scene_templater)
30
30
  production_templater.should_receive(:generate)
31
31
  scene_templater.should_receive(:generate)
@@ -35,7 +35,7 @@ describe Limelight::Commands::CreateCommand do
35
35
 
36
36
  it "should create a scene" do
37
37
  Limelight::Templates::ProductionTemplater.should_not_receive(:new)
38
- scene_templater = make_mock("scene_templater")
38
+ scene_templater = mock("scene_templater")
39
39
  Limelight::Templates::SceneTemplater.should_receive(:new).and_return(scene_templater)
40
40
  scene_templater.should_receive(:generate)
41
41
 
@@ -60,7 +60,7 @@ describe Limelight::Commands::CreateCommand do
60
60
  @command.scene_name.should == "default_scene"
61
61
  @command.template_type.should == "production"
62
62
  @command.production_path.should == "blah"
63
- @command.spec_path.should == "blah/spec"
63
+ @command.spec_path.should == "spec"
64
64
  end
65
65
 
66
66
  it "should have a default production path" do
@@ -8,6 +8,7 @@ require 'limelight/producer'
8
8
  describe Limelight::Commands::OpenCommand do
9
9
 
10
10
  before(:all) do
11
+ @studio = Limelight::Studio.install
11
12
  @command_class = Limelight::Commands::OpenCommand
12
13
  @command = @command_class.new
13
14
  end
@@ -18,14 +19,14 @@ describe Limelight::Commands::OpenCommand do
18
19
 
19
20
  it "should open a production" do
20
21
  Limelight::Main.should_receive(:initialize_context)
21
- Limelight::Studio.should_receive(:open).with("production_name")
22
+ @studio.should_receive(:open).with("production_name")
22
23
 
23
24
  @command.run(["production_name"])
24
25
  end
25
26
 
26
27
  it "should open the default production" do
27
28
  Limelight::Main.should_receive(:initialize_context)
28
- Limelight::Studio.should_receive(:open).with(@command_class::DEFAULT_PRODUCTION)
29
+ @studio.should_receive(:open).with(@command_class::DEFAULT_PRODUCTION)
29
30
 
30
31
  @command.run([])
31
32
  end
@@ -43,8 +44,8 @@ describe Limelight::Commands::OpenCommand do
43
44
 
44
45
  it "should start the studio on drb" do
45
46
  Limelight::Main.should_receive(:initialize_context)
46
- Limelight::Studio.should_receive(:publish_on_drb).with(1234)
47
- Limelight::Studio.should_receive(:open).with("some_prod")
47
+ @studio.should_receive(:publish_on_drb).with(1234)
48
+ @studio.should_receive(:open).with("some_prod")
48
49
 
49
50
  @command.run ["-d", "1234", "some_prod"]
50
51
  end
@@ -16,7 +16,7 @@ describe Limelight::Commands::PackCommand do
16
16
  end
17
17
 
18
18
  it "should pack a production" do
19
- mock_packer = make_mock("packer")
19
+ mock_packer = mock("packer")
20
20
  Limelight::Util::Packer.should_receive(:new).and_return(mock_packer)
21
21
  mock_packer.should_receive(:pack).with("production_to_pack")
22
22
 
@@ -15,7 +15,7 @@ describe Limelight::Commands::UnpackCommand do
15
15
  @mock_output = StringIO.new
16
16
  Limelight::Commands.output = @mock_output
17
17
 
18
- @mock_unpacker = make_mock("unpacker")
18
+ @mock_unpacker = mock("unpacker")
19
19
  Limelight::Util::Packer.stub!(:new).and_return(@mock_unpacker)
20
20
  @mock_unpacker.stub!(:unpack).and_return "unpacked location"
21
21
 
@@ -7,7 +7,7 @@ require 'limelight/dsl/prop_builder'
7
7
  describe Limelight::DSL::PropBuilder do
8
8
 
9
9
  before(:each) do
10
- @caster = make_mock("caster", :fill_cast => nil)
10
+ @caster = mock("caster", :fill_cast => nil)
11
11
  @scene = Limelight::Scene.new(:name => "root", :casting_director => @caster)
12
12
  end
13
13
 
@@ -118,7 +118,7 @@ describe Limelight::DSL::PropBuilder do
118
118
  end
119
119
 
120
120
  it "should install external props" do
121
- loader = make_mock("loader", :exists? => true)
121
+ loader = mock("loader", :exists? => true)
122
122
  loader.should_receive(:load).with("external.rb").and_return("child :id => 123")
123
123
 
124
124
  root = Limelight::build_props(@scene, :id => 321, :build_loader => loader, :casting_director => @caster) do
@@ -145,7 +145,7 @@ describe Limelight::DSL::PropBuilder do
145
145
  end
146
146
 
147
147
  it "should fail when the external file doesn't exist" do
148
- loader = make_mock("loader")
148
+ loader = mock("loader")
149
149
  loader.should_receive(:exists?).with("external.rb").and_return(false)
150
150
 
151
151
  begin
@@ -158,7 +158,7 @@ describe Limelight::DSL::PropBuilder do
158
158
  end
159
159
 
160
160
  it "should fail with PropException when there's problem in the external file" do
161
- loader = make_mock("loader", :exists? => true)
161
+ loader = mock("loader", :exists? => true)
162
162
  loader.should_receive(:load).with("external.rb").and_return("+")
163
163
 
164
164
  begin
@@ -172,7 +172,7 @@ describe Limelight::DSL::PropBuilder do
172
172
 
173
173
  it "should build onto an existing block" do
174
174
  prop = Limelight::Prop.new
175
- scene = Limelight::Scene.new(:casting_director => make_mock(:casting_director, :fill_cast => nil))
175
+ scene = Limelight::Scene.new(:casting_director => mock(:casting_director, :fill_cast => nil))
176
176
  scene << prop
177
177
  builder = Limelight::DSL::PropBuilder.new(prop)
178
178
  block = Proc.new { one; two { three } }
@@ -229,7 +229,7 @@ describe Limelight::DSL::PropBuilder do
229
229
  end
230
230
 
231
231
  it "should allow instance_variable when installing an external props file" do
232
- loader = make_mock("loader", :exists? => true)
232
+ loader = mock("loader", :exists? => true)
233
233
  loader.should_receive(:load).with("external.rb").and_return("child :id => @desired_id")
234
234
 
235
235
  root = Limelight::build_props(@scene, :id => 321, :build_loader => loader, :casting_director => @caster) do
@@ -8,7 +8,7 @@ require 'limelight/theater'
8
8
  describe Limelight::DSL::StageBuilder do
9
9
 
10
10
  before(:each) do
11
- @theater = Limelight::Theater.new
11
+ @theater = Limelight::Theater.new(nil)
12
12
  end
13
13
 
14
14
  it "should give no stages if empty" do
@@ -44,7 +44,7 @@ describe Limelight::FileChooser do
44
44
  it "should return the absolute path if a file was selected" do
45
45
  chooser = Limelight::FileChooser.new(:parent => "parent")
46
46
  chooser.chooser.should_receive(:showOpenDialog).with("parent").and_return(javax.swing.JFileChooser::APPROVE_OPTION)
47
- selected_file = make_mock("selected file", :absolute_path => "selected file's absolute path")
47
+ selected_file = mock("selected file", :absolute_path => "selected file's absolute path")
48
48
  chooser.chooser.should_receive(:getSelectedFile).and_return(selected_file)
49
49
 
50
50
  chooser.choose_file.should == "selected file's absolute path"
@@ -20,8 +20,8 @@ describe Limelight::FileFilter do
20
20
  filter = Limelight::FileFilter.new("Some Description") { |file| file.name == "good" }
21
21
 
22
22
  filter.getDescription().should == "Some Description"
23
- bad_file = make_mock("file", :name => "bad")
24
- good_file = make_mock("file", :name => "good")
23
+ bad_file = mock("file", :name => "bad")
24
+ good_file = mock("file", :name => "good")
25
25
  filter.accept(bad_file).should == false
26
26
  filter.accept(good_file).should == true
27
27
  end
@@ -12,8 +12,8 @@ describe Limelight::Main do
12
12
  end
13
13
 
14
14
  it "should run the specified command" do
15
- command_class = make_mock("command_class")
16
- command = make_mock("command")
15
+ command_class = mock("command_class")
16
+ command = mock("command")
17
17
 
18
18
  Limelight::Commands.should_receive(:[]).with("mock").and_return(command_class)
19
19
  command_class.should_receive(:new).and_return(command)
@@ -20,7 +20,7 @@ describe Limelight::PaintAction do
20
20
  local_pen = nil
21
21
  action = Limelight::PaintAction.new { |pen| local_pen = pen }
22
22
 
23
- graphics = make_mock("graphics", :setColor => nil, :setStroke => nil, :setRenderingHint => nil)
23
+ graphics = mock("graphics", :setColor => nil, :setStroke => nil, :setRenderingHint => nil)
24
24
  action.invoke(graphics)
25
25
 
26
26
  local_pen.class.should == Limelight::Pen
@@ -7,7 +7,7 @@ require 'limelight/pen'
7
7
  describe Limelight::Pen do
8
8
 
9
9
  before(:each) do
10
- @context = make_mock("context", :setColor => nil, :setStroke => nil, :setRenderingHint => nil)
10
+ @context = mock("context", :setColor => nil, :setStroke => nil, :setRenderingHint => nil)
11
11
  @pen = Limelight::Pen.new(@context)
12
12
  end
13
13
 
@@ -8,9 +8,10 @@ describe Limelight::Producer do
8
8
 
9
9
  before(:each) do
10
10
  TestDir.clean
11
- Limelight::Studio.reset
11
+ Limelight::Studio.uninstall
12
12
  @root_dir = TestDir.path("test_prod")
13
13
  @producer = Limelight::Producer.new(@root_dir)
14
+ Limelight::Studio.install
14
15
  end
15
16
 
16
17
  it "should have loader on creation" do
@@ -18,7 +19,7 @@ describe Limelight::Producer do
18
19
  end
19
20
 
20
21
  it "should take an optional theater on creation" do
21
- theater = make_mock("theater")
22
+ theater = mock("theater")
22
23
  producer = Limelight::Producer.new("/tmp", theater)
23
24
 
24
25
  producer.theater.should == theater
@@ -32,7 +33,7 @@ describe Limelight::Producer do
32
33
  it "should load props" do
33
34
  TestDir.create_file("test_prod/props.rb", "child :id => 321")
34
35
 
35
- scene = @producer.load_props(:path => TestDir.path("test_prod"), :casting_director => make_mock("casting_director", :fill_cast => nil))
36
+ scene = @producer.load_props(:path => TestDir.path("test_prod"), :casting_director => mock("casting_director", :fill_cast => nil))
36
37
  scene.illuminate
37
38
  scene.children.size.should == 1
38
39
  scene.children[0].name.should == "child"
@@ -40,7 +41,7 @@ describe Limelight::Producer do
40
41
  end
41
42
 
42
43
  it "should load props even when props.rd doesn't exist." do
43
- scene = @producer.load_props(:path => TestDir.path("test_prod"), :casting_director => make_mock("casting_director", :fill_cast => nil))
44
+ scene = @producer.load_props(:path => TestDir.path("test_prod"), :casting_director => mock("casting_director", :fill_cast => nil))
44
45
  scene.children.size.should == 0
45
46
  end
46
47
 
@@ -52,7 +53,7 @@ describe Limelight::Producer do
52
53
 
53
54
  it "should load styles" do
54
55
  TestDir.create_file("test_prod/styles.rb", "alpha { width 100 }")
55
- Limelight::Studio.stub!(:builtin_styles).and_return({})
56
+ Limelight::Producer.stub!(:builtin_styles).and_return({})
56
57
 
57
58
  styles = @producer.load_styles(Limelight::Scene.new(:path => TestDir.path("test_prod")))
58
59
  styles.size.should == 1
@@ -65,7 +66,7 @@ describe Limelight::Producer do
65
66
  # TestDir.create_file("test_prod/props.rb", "one\n+\nthree")
66
67
  #
67
68
  # begin
68
- # result = @producer.load_props(:path => TestDir.path("test_prod"), :casting_director => make_mock("casting_director", :fill_cast => nil))
69
+ # result = @producer.load_props(:path => TestDir.path("test_prod"), :casting_director => mock("casting_director", :fill_cast => nil))
69
70
  # result.should == nil # should never perform
70
71
  # rescue Limelight::DSL::BuildException => e
71
72
  # e.line_number.should == 3
@@ -131,8 +132,8 @@ describe Limelight::Producer do
131
132
  end
132
133
 
133
134
  it "should open a scene" do
134
- stage = make_mock("stage")
135
- scene = make_mock("scene")
135
+ stage = mock("stage")
136
+ scene = mock("scene")
136
137
  @producer.should_receive(:load_props).with(:production => @producer.production, :casting_director => anything, :path => TestDir.path("test_prod/name"), :name => "name").and_return(scene)
137
138
  @producer.should_receive(:load_styles).and_return("styles")
138
139
  scene.should_receive(:styles=)
@@ -142,7 +143,7 @@ describe Limelight::Producer do
142
143
  end
143
144
 
144
145
  it "should load empty styles if styles.rb doesn't exist" do
145
- Limelight::Studio.stub!(:builtin_styles).and_return({})
146
+ Limelight::Producer.stub!(:builtin_styles).and_return({})
146
147
 
147
148
  @producer.load_styles(Limelight::Scene.new(:path => TestDir.path("test_prod"))).should == {}
148
149
  end
@@ -197,8 +198,8 @@ describe Limelight::Producer do
197
198
  end
198
199
 
199
200
  it "should allow options such as instance variables to be passed to open_scene" do
200
- stage = make_mock("stage")
201
- scene = make_mock("scene")
201
+ stage = mock("stage")
202
+ scene = mock("scene")
202
203
  @producer.should_receive(:load_props).with(:instance_variables => { :foo => "bar" }, :production => @producer.production, :casting_director => anything, :path => TestDir.path("test_prod/name"), :name => "name").and_return(scene)
203
204
  @producer.should_receive(:load_styles).and_return("styles")
204
205
  scene.should_receive(:styles=)
@@ -207,4 +208,22 @@ describe Limelight::Producer do
207
208
  @producer.open_scene("name", stage, :instance_variables => { :foo => "bar" })
208
209
  end
209
210
 
211
+ it "should give the same buildin_styles hash twice" do
212
+ Limelight::Producer.builtin_styles.should be(Limelight::Producer.builtin_styles)
213
+ Limelight::Producer.builtin_styles["limelight_builtin_players_curtains"].should_not == nil
214
+ end
215
+
216
+ it "should close a production" do
217
+ theater = mock("theater")
218
+ production = mock("production", :theater => theater, :closed? => false)
219
+ production.should_receive(:closed=).with(true)
220
+ production.should_receive(:production_closing)
221
+ theater.should_receive(:close)
222
+ production.should_receive(:production_closed)
223
+ Limelight::Context.instance.studio.should_receive(:production_closed).with(production)
224
+
225
+ close_thread = @producer.close(production)
226
+ close_thread.join()
227
+ end
228
+
210
229
  end