spec/spec_helper.rb in wally-0.0.33 vs spec/spec_helper.rb in wally-0.0.34
- old
+ new
@@ -7,5 +7,29 @@
before do
ARGV.clear
ARGV << "application-features"
end
+
+RSpec.configure do |config|
+ config.after :each do
+ Wally::Project.delete_all
+ end
+end
+
+def project name
+ project = Wally::Project.first(:name => name)
+ unless project
+ project = Wally::Project.create(:name => name)
+ end
+ project
+end
+
+def create_feature project_name, path, content
+ project = project(project_name)
+ feature = Wally::Feature.new({
+ :path => path,
+ :gherkin => Wally::ParsesFeatures.new.parse(content)
+ })
+ project.features << feature
+ project.save
+end