@@ -26,7 +26,7 @@ def revoke!(*args, &block)
26
26
27
27
def exists_and_identical? ( source_path , destination_path )
28
28
%w( config.rb README ) . each do |file |
29
- source = File . join ( source_root , source_path , file )
29
+ source = File . join ( source_root , source_path , file )
30
30
destination = File . join ( destination_root , destination_path , file )
31
31
32
32
expect ( File . exist? ( destination ) ) . to be true
@@ -149,22 +149,18 @@ def exists_and_identical?(source_path, destination_path)
149
149
end
150
150
151
151
context 'windows temp directories' , :if => windows? do
152
- before ( :each ) { @temp_dir = Dir . mktmpdir ( "thor" ) }
152
+ let ( :spec_dir ) { File . join ( @temp_dir , "spec" ) }
153
+
154
+ before ( :each ) do
155
+ @temp_dir = Dir . mktmpdir ( "thor" )
156
+ Dir . mkdir ( spec_dir )
157
+ File . new ( File . join ( spec_dir , 'spec_helper.rb' ) , 'w' )
158
+ end
159
+
160
+ after ( :each ) { FileUtils . rm_rf ( @temp_dir ) }
153
161
it "works with windows temp dir" do
154
- puts @temp_dir
155
- old_invoker = @invoker
156
- @invoker = WhinyGenerator . new ( [ 1 , 2 ] , { } , :destination_root => @temp_dir )
157
- begin
158
- invoke! "doc" , "docs"
159
- file = File . join ( @temp_dir , "docs" , "components" )
160
- expect ( File . exist? ( file ) ) . to be true
161
- expect ( File . directory? ( file ) ) . to be true
162
- ensure
163
- @invoker = old_invoker
164
- end
165
- source_root = File . join ( @temp_dir , "docs" )
166
- invoke! source_root , "docs"
167
- file = File . join ( destination_root , "docs" , "components" )
162
+ invoke! spec_dir , "specs"
163
+ file = File . join ( destination_root , "specs" )
168
164
expect ( File . exist? ( file ) ) . to be true
169
165
expect ( File . directory? ( file ) ) . to be true
170
166
end
0 commit comments