File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 66require "sus/shared"
77require "build/files"
88
9+ require "sus/fixtures/temporary_directory_context"
10+
911module Teapot
1012 module Command
1113 # Scratch directory used by clone integration tests.
1214 # The test deletes and recreates this directory during the run.
13- AClone = Sus ::Shared ( "teapot/command/clone fixture" ) do
14- let ( :root ) { ::Build ::Files ::Path . new ( File . expand_path ( "clone" , __dir__ ) ) }
15+ AClone = Sus ::Shared ( "a clone" ) do
16+ include Sus ::Fixtures ::TemporaryDirectoryContext
17+
18+ let ( :template_root ) { ::Build ::Files ::Path . new ( File . expand_path ( "clone" , __dir__ ) ) }
1519 end
1620 end
1721end
Original file line number Diff line number Diff line change @@ -13,10 +13,10 @@ module Command
1313 AFetch = Sus ::Shared ( "a fetch" ) do
1414 include Sus ::Fixtures ::TemporaryDirectoryContext
1515
16- let ( :fetch_root ) { ::Build ::Files ::Path . new ( File . expand_path ( "fetch" , __dir__ ) ) }
16+ let ( :template_root ) { ::Build ::Files ::Path . new ( File . expand_path ( "fetch" , __dir__ ) ) }
1717
1818 before do
19- FileUtils . cp_r ( File . join ( fetch_root , "test-project" ) , root )
19+ FileUtils . cp_r ( File . join ( template_root , "test-project" ) , root )
2020 end
2121 end
2222 end
Original file line number Diff line number Diff line change 77require "teapot/command/a_clone"
88
99describe Teapot ::Command ::Clone do
10- include_context Teapot ::Command ::AClone
10+ include Teapot ::Command ::AClone
1111
1212 let ( :source ) { "https://github.com/kurocha/tagged-format" }
1313
14- let ( :top ) { Teapot ::Command ::Top [ "--root" , root . to_s ] }
15-
16- before do
17- root . delete
18- end
14+ let ( :project_root ) { File . join ( root , "project" ) }
15+ let ( :top ) { Teapot ::Command ::Top [ "--root" , project_root . to_s ] }
1916
2017 with "clone remote source" do
21- let ( :subject ) { top [ "clone" , source ] }
18+ let ( :subject ) { top [ "clone" , template_root . to_s ] }
2219
2320 it "should checkout files" do
2421 subject . call
2522
26- expect ( File ) . to be ( :exist? , root + "teapot.rb" )
23+ expect ( File ) . to be ( :exist? , File . join ( project_root , "teapot.rb" ) )
2724
2825 selection = top . context . select
2926
You can’t perform that action at this time.
0 commit comments