Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Began spec-ing out first feature

  • Loading branch information...
commit 2383a6ec8d35538691890dd1853c8948eed9781d 1 parent d2d6c54
@zettabyte authored
View
3  features/mount_file_silo.feature
@@ -15,7 +15,6 @@ Feature: Mount file silo
The Dax::FileSilo instance is a Dax::FileSilo::DirectFileSystem sub-type.
Given a local directory named "direct"
- When I mount it using a direct, file-system silo
- And I name the file silo "test"
+ When I mount the local directory using a direct, file-system silo, naming it "test"
Then I can access a direct, file-system silo named "test"
View
12 features/step_definitions/steps.rb
@@ -0,0 +1,12 @@
+# encoding: utf-8
+Given /^a local directory named "([^"]*)"$/ do |name|
+ prepare_local_directory(name)
+end
+
+When /^I mount the local directory using a direct, file\-system silo, naming it "([^"]*)"$/ do |name|
+ Dax.mount(name, local_directory)
+end
+
+Then /^I can access a direct, file\-system silo named "([^"]*)"$/ do |name|
+ Dax.silo(name).name.should == name
+end
View
16 features/support/env.rb
@@ -0,0 +1,16 @@
+# encoding: utf-8
+PROJECT_ROOT = File.expand_path(File.join('..', '..', '..'), __FILE__)
+TEST_ROOT = File.join(PROJECT_ROOT, 'test')
+$:.push File.join(PROJECT_ROOT, 'lib')
+require 'dax'
+
+module LocalFileStoreSetup
+
+ def prepare_local_directory(name)
+ @local_directory = File.join(TEST_ROOT, name)
+ FileUtils.mkdir_p(@local_directory)
+ end
+ attr_reader :local_directory
+
+end
+World(LocalFileStoreSetup)
View
1  features/support/hooks.rb
@@ -0,0 +1 @@
+# encoding: utf-8
View
11 lib/dax.rb
@@ -1,3 +1,14 @@
# encoding: utf-8
+require 'dax/silo'
+
module Dax
+ def mount(name, location)
+ Silo.mount(name, location)
+ end
+ module_function :mount
+
+ def silo(name)
+ Silo.find(name)
+ end
+ module_function :silo
end
View
10 lib/dax/silo.rb
@@ -0,0 +1,10 @@
+# encoding: utf-8
+module Dax
+ class Silo
+ def self.mount(name, location)
+ end
+
+ def self.find(name)
+ end
+ end
+end
Please sign in to comment.
Something went wrong with that request. Please try again.