Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Copying files in on setup

  • Loading branch information...
commit 8e77abc4453b76f46c22dd29bc85a1ed0518bf12 1 parent 2edb605
@qrush qrush authored
Showing with 18 additions and 0 deletions.
  1. +5 −0 lib/pythagoras.rb
  2. +13 −0 test/pythagoras_test.rb
View
5 lib/pythagoras.rb
@@ -25,4 +25,9 @@ def self.config
Kernel.abort("You need a config file. Check the readme please!")
end
end
+
+ def self.setup
+ FileUtils.mkdir_p(config['site'])
+ FileUtils.cp(Dir[File.join(File.dirname(__FILE__), '..', 'template', '*.{css,ico}')], config['site'])
+ end
end
View
13 test/pythagoras_test.rb
@@ -47,4 +47,17 @@ class PythagorasTest < Test::Unit::TestCase
Pythagoras.config
end
end
+
+ context "setting up" do
+ setup do
+ @config = {'site' => '/path/to/site'}
+ stub(Pythagoras).config { @config }
+ end
+
+ should "move files from the template over" do
+ mock(FileUtils).mkdir_p(@config['site'])
+ mock(FileUtils).cp(is_a(Array), @config['site'])
+ Pythagoras.setup
+ end
+ end
end
Please sign in to comment.
Something went wrong with that request. Please try again.