Skip to content

Commit

Permalink
spec setup
Browse files Browse the repository at this point in the history
  • Loading branch information
rughetto committed Jan 20, 2009
1 parent 1cc75df commit 3725554
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 8 deletions.
18 changes: 12 additions & 6 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,14 @@ require 'rake/gempackagetask'

require 'merb-core'
require 'merb-core/tasks/merb'
require 'spec/rake/spectask'

GEM_NAME = "rear_views"
GEM_VERSION = "0.0.1"
AUTHOR = "Your Name"
EMAIL = "Your Email"
HOMEPAGE = "http://merbivore.com/"
SUMMARY = "Merb plugin that provides ..."
AUTHOR = "Rue The Ghetto"
EMAIL = "[email protected]"
HOMEPAGE = "http://github.com/rughetto/rear_views"
SUMMARY = "Generators REST views for a resource, so that complex views and forms can be easily built. Currently only AR introspection and ERB templates."

spec = Gem::Specification.new do |s|
s.rubyforge_project = 'merb'
Expand All @@ -23,10 +24,9 @@ spec = Gem::Specification.new do |s|
s.author = AUTHOR
s.email = EMAIL
s.homepage = HOMEPAGE
s.add_dependency('merb', '>= 1.0.8')
s.add_dependency('merb', '>= 1.0')
s.require_path = 'lib'
s.files = %w(LICENSE README Rakefile TODO) + Dir.glob("{lib,spec}/**/*")

end

Rake::GemPackageTask.new(spec) do |pkg|
Expand All @@ -48,4 +48,10 @@ task :gemspec do
File.open("#{GEM_NAME}.gemspec", "w") do |file|
file.puts spec.to_ruby
end
end

Spec::Rake::SpecTask.new do |t|
t.warning = true
t.spec_opts = ["--format", "specdoc", "--colour"]
t.spec_files = Dir['spec/**/*_spec.rb'].sort
end
2 changes: 1 addition & 1 deletion lib/generators/rear_views_generator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ def self.source_root
end

desc <<-DESC
Generators a REST views for a resource, so that complex views and forms can be easily built
Generators REST views for a resource, so that complex views and forms can be easily built
DESC

first_argument :name, :required => true, :desc => "model name"
Expand Down
8 changes: 8 additions & 0 deletions lib/generators/views/%file_name%/new.html.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<h1>New <%= class_name %></h1>

<%%= form_tag @<%= class_name %>, resource(:<%= class_name %>, :new) do %>

<%% end =%>


<p>This file was generated by the Rear Views gem/plugin. The file is located at <tt>app/views/<%= file_name %>/new.html.erb</tt> and should be edited to meet your needs</p>
5 changes: 4 additions & 1 deletion spec/rear_views_spec.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
require File.dirname(__FILE__) + '/spec_helper'

describe "rear_views" do
it "should do nothing" do
it "spec tests should be setup correctly" do
true.should == true
end

describe "rendering" do
end
end
2 changes: 2 additions & 0 deletions spec/spec.opts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
--colour
--backtrace

0 comments on commit 3725554

Please sign in to comment.