public
Description: Plugin for running Ruby in the browser seamlessly from Rails, and display either HTML or vector graphics
Homepage: http://jimmy.schementi.com/silverline
Clone URL: git://github.com/jschementi/silverline.git
Fixed specs
jschementi (author)
Fri Jul 25 18:19:35 -0700 2008
commit  9efcac0a32de7bfbed399345b6b4018d1a0e736a
tree    89c09f53ee95afde9240ea7948e076827dd507d2
parent  d6a57b6d45f1fd588978af38c45ca093f2e0268a
...
27
28
29
 
 
 
 
 
 
 
30
31
32
33
34
35
36
 
 
37
38
39
...
51
52
53
 
 
 
 
 
 
 
54
55
56
...
27
28
29
30
31
32
33
34
35
36
37
38
39
 
 
 
 
40
41
42
43
44
...
56
57
58
59
60
61
62
63
64
65
66
67
68
0
@@ -27,13 +27,18 @@ describe Silverline::Essential::Generator do
0
     FileSystemWatcher.stub!(:new).and_return @watcher
0
     
0
     @gen = Silverline::Essential::Generator
0
+
0
+    Silverline::Essential.instance_eval{ remove_const :XAP } if defined?(Silverline::Essential::XAP)
0
+    Silverline::Essential::XAP = mock("XAP")
0
+    @xap = Silverline::Essential::XAP
0
+    xap_instance = mock("XAPInstance")
0
+    @xap.stub!(:new).and_return xap_instance
0
+    xap_instance.stub!(:generate)
0
   end
0
   
0
   it "should watch directories to put into XAP" do
0
-    FileUtils = mock("FileUtils")
0
-    FileUtils.should_receive(:mkdir_p).with(Silverline::TMP_CLIENT)
0
-    FileUtils.should_receive(:mkdir_p).with(Silverline::CLIENT_ROOT)
0
-    
0
+    @gen.should_receive(:create_directories)
0
+
0
     @watcher.should_receive(:addDirectory).with(Silverline::CLIENT_ROOT)
0
     @watcher.should_receive(:addDirectory).with(Silverline::PLUGIN_CLIENT)
0
     
0
@@ -51,6 +56,13 @@ describe Silverline::Essential::Generator do
0
     @gen.register
0
   end
0
 
0
+  it "should create required directories" do
0
+    FileUtils = mock("FileUtils")
0
+    FileUtils.should_receive(:mkdir_p).with(Silverline::TMP_CLIENT)
0
+    FileUtils.should_receive(:mkdir_p).with(Silverline::CLIENT_ROOT)
0
+    @gen.create_directories
0
+  end
0
+
0
   it "should delete the XAP" do
0
     File = mock("File")
0
     FileUtils = mock("FileUtils", :null_object => true)
...
1
2
3
4
 
5
6
 
7
 
 
 
 
8
9
10
...
14
15
16
 
17
18
19
...
1
2
 
 
3
4
 
5
6
7
8
9
10
11
12
13
...
17
18
19
20
21
22
23
0
@@ -1,10 +1,13 @@
0
 require File.dirname(__FILE__) + '/../../spec_helper.rb'
0
 
0
-Silverline::Essential.instance_eval{remove_const :Xap} if defined?(Silverline::Essential::Xap)
0
-Silverline::Essential::Xap = :chiron
0
+Silverline::Essential.instance_eval{remove_const :XAP} if defined?(Silverline::Essential::XAP)
0
 
0
-def prepare_xap(platform = nil)
0
+def define_xap
0
   Silverline::Essential.instance_eval{remove_const :Xap} if defined?(Silverline::Essential::Xap)
0
+end
0
+
0
+def prepare_xap(platform = nil)
0
+  define_xap
0
   yield
0
   load 'silverline/essential/xap.rb'
0
   @xap = Silverline::Essential::XAP.new("foo", "Bar")
0
@@ -14,6 +17,7 @@ end
0
 describe "XAPBase" do
0
   
0
   it "should initialize itself with a file to XAP to and a directory to XAP" do
0
+    Silverline::Essential::Xap = :chiron
0
     load 'silverline/essential/xap.rb'
0
     xapbase = Silverline::Essential::XAPBase.new("foo", "Bar")
0
     xapbase.instance_variable_get(:@file) == "foo"

Comments