Permalink
Browse files

added tests to validate default directory and files

  • Loading branch information...
1 parent 25b4ef2 commit 5dbe8540befb990c7f29e070d58d24dabe3c4f45 @cheezy committed Jun 9, 2012
View
@@ -0,0 +1,3 @@
+dm:
+ value1: this is value 1
+ value2: this is value 2
@@ -1,7 +1,7 @@
Feature: Functionality of the data_magic gem
Background:
- Given I have read the yaml file
+ Given I have read the yaml file from features/yaml
When I ask for the data for "dm"
Scenario: Getting basic data from the yaml
@@ -0,0 +1,8 @@
+Feature: Default file and directory functionality of the data_magic gem
+
+ Scenario: Using the default file and directory
+ Given I have read the default yaml file from the default location
+ When I ask for the data for "dm"
+ Then the value for "value1" should be "this is value 1"
+ And the value for "value2" should be "this is value 2"
+
@@ -3,10 +3,15 @@ class TestClass
end
-Given /^I have read the yaml file$/ do
+Given /^I have read the yaml file from features\/yaml$/ do
+ DataMagic.yml_directory = 'features/yaml'
DataMagic.load "example.yml"
end
+Given /^I have read the default yaml file from the default location$/ do
+
+end
+
When /^I ask for the data for "(.+)"$/ do |key|
@data = TestClass.new.data_for key
end
View
@@ -3,4 +3,7 @@
require 'rspec/expectations'
require 'data_magic'
-DataMagic.yml_directory = 'features/yaml'
+Before do
+ DataMagic.yml_directory = nil
+ DataMagic.yml = nil
+end

0 comments on commit 5dbe854

Please sign in to comment.