Skip to content

Commit

Permalink
Small rspec test folder fix. Bumping up to 0.3.2
Browse files Browse the repository at this point in the history
  • Loading branch information
akitaonrails committed Sep 9, 2009
1 parent cc7da7b commit 4521e75
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 9 deletions.
2 changes: 1 addition & 1 deletion VERSION.yml
@@ -1,4 +1,4 @@
---
:minor: 3
:patch: 1
:patch: 2
:major: 0
2 changes: 1 addition & 1 deletion dry_scaffold.gemspec
Expand Up @@ -2,7 +2,7 @@

Gem::Specification.new do |s|
s.name = %q{dry_scaffold}
s.version = "0.3.1"
s.version = "0.3.2"

s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
s.authors = ["Jonas Grimfelt"]
Expand Down
2 changes: 1 addition & 1 deletion generators/dry_model/dry_model_generator.rb
Expand Up @@ -60,7 +60,7 @@ def manifest

# Model Tests.
unless options[:skip_tests]
model_tests_path = File.join(TEST_PATHS[test_framework], 'unit')
model_tests_path = File.join(TEST_PATHS[test_framework], UNIT_TESTS_PATH[test_framework])
m.directory File.join(model_tests_path, class_path)
m.template File.join('models', 'tests', "#{test_framework}", 'unit_test.rb'),
File.join(model_tests_path, class_path, "#{file_name}_test.rb")
Expand Down
@@ -1,10 +1,10 @@
require File.dirname(__FILE__) + '/../spec_helper'

describe <%= class_name %> do
<% if options[:fixtures] -%>
fixtures :<%= table_name %>
<% if options[:fixtures] -%>
fixtures :<%= table_name %>

<% end -%>
<% end -%>
it "should be valid" do
Comment.new.should be_valid
end
Expand Down
2 changes: 1 addition & 1 deletion generators/dry_scaffold/dry_scaffold_generator.rb
Expand Up @@ -142,7 +142,7 @@ def manifest

# Controller Tests.
unless options[:skip_tests]
controller_tests_path = File.join(TEST_PATHS[test_framework], 'functional')
controller_tests_path = File.join(TEST_PATHS[test_framework], FUNCTIONAL_TESTS_PATH[test_framework])
m.directory File.join(controller_tests_path, controller_class_path)
m.template File.join('controllers', 'tests', "#{test_framework}", 'functional_test.rb'),
File.join(controller_tests_path, controller_class_path, "#{controller_file_name}_controller_test.rb")
Expand Down
12 changes: 10 additions & 2 deletions lib/dry_generator.rb
Expand Up @@ -63,8 +63,16 @@ class DryGenerator < Rails::Generator::NamedBase
DEFAULT_FACTORY_FRAMEWORK = :fixtures

TESTS_PATH = File.join('test').freeze
FUNCTIONAL_TESTS_PATH = File.join(TESTS_PATH, 'functional').freeze
UNIT_TESTS_PATH = File.join(TESTS_PATH, 'unit').freeze
FUNCTIONAL_TESTS_PATH = {
:test => 'functional',
:shoulda => 'functional',
:rspec => 'controllers'
}
UNIT_TESTS_PATH = {
:test => 'unit',
:shoulda => 'unit',
:rspec => 'models',
}

NON_ATTR_ARG_KEY_PREFIX = '_'.freeze

Expand Down

0 comments on commit 4521e75

Please sign in to comment.