Permalink
Browse files

fixing framework specs

  • Loading branch information...
larsburgess committed Mar 2, 2009
1 parent 5413515 commit 112f1e17adc32559b4dafe6daac8540cbfa73e1d
View
@@ -1,37 +1,36 @@
*~
+*.iseq
.DS_Store
-shared/framework/coverage
-shared/framework/pkg
-iphone/build/*
-iphone/rhorubylib/build/*
-iphone/rhosynclib/build/*
-iphone/bin/*
-mac/bin/*
-iphone/*/*.link
-wm/bin/*
-win32/bin/*
-wm/target/*
-wm/build/cleanup.js
-iphone/*/rholog.txt
+platform/iphone/build/*
+platform/iphone/rhorubylib/build/*
+platform/iphone/rhosynclib/build/*
+platform/iphone/bin/*
+platform/mac/bin/*
+platform/iphone/*/*.link
+platform/wm/bin/*
+platform/win32/bin/*
+platform/wm/target/*
+platform/wm/build/cleanup.js
+platform/iphone/*/rholog.txt
-bb/.metadata/*
-bb/bin/*
-bb/target/*
-bb/build/LogFile.txt
-bb/*/.settings
-bb/*/.project
-bb/*/.classpath
+platform/bb/.metadata/*
+platform/bb/bin/*
+platform/bb/target/*
+platform/bb/build/LogFile.txt
+platform/bb/*/.settings
+platform/bb/*/.project
+platform/bb/*/.classpath
*.cso
*.csl
*.err
-bb/.BB.jdw/*.files
+platform/bb/.BB.jdw/*.files
*.jad
-bb/build/rholog.txt
+platform/bb/build/rholog.txt
-symbian/.metadata/*
-symbian/bin/*
-symbian/target/*
-symbian/*/.project
+platform/symbian/.metadata/*
+platform/symbian/bin/*
+platform/symbian/target/*
+platform/symbian/*/.project
abld.bat
ABLD.BAT
#*.sis
@@ -36,7 +36,7 @@ require 'newgem/tasks' # load /tasks/*.rake
Rake.application.remove_task(:test)
Dir['tasks/**/*.rake'].each { |t| load t }
-desc "Run the specs under spec/models"
+desc "Run the specs under spec"
Spec::Rake::SpecTask.new do |t|
t.spec_opts = ['--options', "spec/spec.opts"]
t.spec_files = FileList['spec/**/*_spec.rb']
@@ -1,33 +0,0 @@
-require File.dirname(__FILE__) + '/generator_spec_helper'
-
-describe Rhogen::AppGenerator do
-
- app_name = 'NeatApp'
-
- it "should complain if no name is specified" do
- lambda {
- @generator = Rhogen::AppGenerator.new('/tmp', {})
- }.should raise_error(::Templater::TooFewArgumentsError)
- end
-
-
- it "should generate class_name" do
- @generator = Rhogen::AppGenerator.new('/tmp', {}, 'Class-With-Hyphens')
- @generator.class_name.should == 'ClassWithHyphens'
- end
-
- before do
- @generator = Rhogen::AppGenerator.new('/tmp', {}, app_name)
- end
-
- it "should create application.rb, index.erb, and layout.erb files" do
- ['application.rb', 'index.erb', 'layout.erb'].each do |template|
- @generator.should create("/tmp/#{app_name}/#{template}")
- end
- end
-
- it "should generate valid erb templates" do
- pending "need to figure out how to validate erb"
- end
-
-end
@@ -1,12 +0,0 @@
-$:.push File.join(File.dirname(__FILE__), '..', 'lib')
-
-require 'rubygems'
-require 'spec'
-require 'templater/spec/helpers'
-
-$:.push File.join(File.dirname(__FILE__), '..', 'generators')
-require 'rhogen'
-
-Spec::Runner.configure do |config|
- config.include Templater::Spec::Helpers
-end
@@ -1,36 +0,0 @@
-require File.dirname(__FILE__) + '/generator_spec_helper'
-require 'fileutils'
-
-describe Rhogen::ModelGenerator do
-
- model_name = 'employee'
-
- it "should complain if no name is specified" do
- lambda {
- @generator = Rhogen::ModelGenerator.new('/tmp', {})
- }.should raise_error(::Templater::TooFewArgumentsError)
- end
-
- before do
- @generator = Rhogen::ModelGenerator.new('/tmp', {}, model_name, "http://something.com/sources/5", 5, "name,industry,address")
- end
-
- it "should have attributes" do
- @generator.attributes?.should == true
- end
-
- it "should have all attributes" do
- @generator.attributes.should == ['name', 'industry', 'address']
- end
-
- it "should create config.rb, controller.rb, index.erb, edit.erb, and new.erb files" do
- ['config.rb', 'controller.rb', 'index.erb', 'edit.erb', 'new.erb', 'show.erb'].each do |template|
- @generator.should create("/tmp/#{model_name.camel_case}/#{template}")
- end
- end
-
- it "should generate valid erb templates" do
- pending "need to figure out how to validate erb"
- end
-
-end
@@ -1,27 +0,0 @@
-require File.dirname(__FILE__) + '/generator_spec_helper'
-
-describe Rhogen::SourceGenerator do
-
- source_name = 'NeatSource'
-
- it "should complain if no name is specified" do
- lambda {
- @generator = Rhogen::SourceGenerator.new('/tmp', {})
- }.should raise_error(::Templater::TooFewArgumentsError)
- end
-
- before do
- @generator = Rhogen::SourceGenerator.new('/tmp', {}, source_name)
- end
-
- it "should create neat_source.rb files" do
- ['neat_source.rb'].each do |template|
- @generator.should create("/tmp/lib/#{template}")
- end
- end
-
- it "should generate valid erb templates" do
- pending "need to figure out how to validate erb"
- end
-
-end
@@ -1,5 +1,4 @@
-%w[rubygems rake rake/clean fileutils newgem].each { |f| require f }
-
+%w[rubygems rake rake/clean spec/rake/spectask fileutils newgem].each { |f| require f }
$:.unshift(File.join(File.dirname(__FILE__), 'lib'))
require 'lib/version.rb'
@@ -35,5 +34,18 @@ end
require 'newgem/tasks' # load /tasks/*.rake
# remove test task TODO: why does this run anyway?
-#Rake.application.remove_task(:test)
+Rake.application.remove_task(:test)
Dir['tasks/**/*.rake'].each { |t| load t }
+
+desc "Run the specs under spec"
+Spec::Rake::SpecTask.new do |t|
+ t.spec_opts = ['--options', "spec/spec.opts"]
+ t.spec_files = FileList['spec/**/*_spec.rb']
+ t.rcov = true
+ t.rcov_opts = ['--include',
+ '"bin/*,generators/*"',
+ '-x',
+ 'spec,gems',
+ '--text-report',
+ '--html']
+end
@@ -0,0 +1,7 @@
+begin
+ require 'spec'
+rescue LoadError
+ require 'rubygems'
+ gem 'rspec'
+ require 'spec'
+end

0 comments on commit 112f1e1

Please sign in to comment.