Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 71 lines (61 sloc) 1.943 kb
0a59e0c @yabawock Always use # encoding: utf-8 declaration
yabawock authored
1 # encoding: utf-8
b77e11a @yabawock Make Rakefile compatible with rails2 & rails3
yabawock authored
2 require 'rubygems'
dcf8beb Initial Commit
Justin French authored
3 require 'rake'
4 require 'rake/rdoctask'
542d308 @grimen Fixing some issues with the specs to get them to run on Ruby 1.9.x. S…
grimen authored
5
b86764b @grimen Enhanced the Rakefile a bit to make it handle missing RSpec dependenc…
grimen authored
6 begin
b77e11a @yabawock Make Rakefile compatible with rails2 & rails3
yabawock authored
7 gem 'rspec', '>= 1.2.6'
8 gem 'rspec-rails', '>= 1.2.6'
9 require 'spec'
b86764b @grimen Enhanced the Rakefile a bit to make it handle missing RSpec dependenc…
grimen authored
10 require 'spec/rake/spectask'
11 rescue LoadError
12 begin
b77e11a @yabawock Make Rakefile compatible with rails2 & rails3
yabawock authored
13 require 'rspec/core/rake_task.rb'
14 require 'rspec/core/version'
b86764b @grimen Enhanced the Rakefile a bit to make it handle missing RSpec dependenc…
grimen authored
15 rescue LoadError
16 puts "[formtastic:] RSpec - or one of it's dependencies - is not available. Install it with: sudo gem install rspec-rails"
17 end
18 end
dcf8beb Initial Commit
Justin French authored
19
281dd18 @xaviershay rspec support - test_helper and rake task
xaviershay authored
20 desc 'Default: run unit specs.'
21 task :default => :spec
dcf8beb Initial Commit
Justin French authored
22
23 desc 'Generate documentation for the formtastic plugin.'
24 Rake::RDocTask.new(:rdoc) do |rdoc|
25 rdoc.rdoc_dir = 'rdoc'
26 rdoc.title = 'Formtastic'
27 rdoc.options << '--line-numbers' << '--inline-source'
8e2ca3a @justinfrench modified Rakefile to build with README.textile
authored
28 rdoc.rdoc_files.include('README.textile')
dcf8beb Initial Commit
Justin French authored
29 rdoc.rdoc_files.include('lib/**/*.rb')
30 end
7fef413 @justinfrench added a rake task 'specdoc' for running the specs with specdoc format…
authored
31
b86764b @grimen Enhanced the Rakefile a bit to make it handle missing RSpec dependenc…
grimen authored
32 if defined?(Spec)
33 desc 'Test the formtastic plugin.'
34 Spec::Rake::SpecTask.new('spec') do |t|
35 t.spec_files = FileList['spec/**/*_spec.rb']
36 t.spec_opts = ["-c"]
37 end
38
39 desc 'Test the formtastic plugin with specdoc formatting and colors'
40 Spec::Rake::SpecTask.new('specdoc') do |t|
41 t.spec_files = FileList['spec/**/*_spec.rb']
42 t.spec_opts = ["--format specdoc", "-c"]
43 end
44
45 desc "Run all examples with RCov"
46 Spec::Rake::SpecTask.new('examples_with_rcov') do |t|
47 t.spec_files = FileList['spec/**/*_spec.rb']
48 t.rcov = true
49 t.rcov_opts = ['--exclude', 'spec,Library']
50 end
a27aa2b @justinfrench Added in a Rake task for running the specs with rcov, plus a line in …
authored
51 end
b77e11a @yabawock Make Rakefile compatible with rails2 & rails3
yabawock authored
52
4b3bb60 @yabawock Rspec renamed to RSpec (since 2.0.0.beta.9)
yabawock authored
53 if defined?(RSpec)
b77e11a @yabawock Make Rakefile compatible with rails2 & rails3
yabawock authored
54 desc 'Test the formtastic plugin.'
4b3bb60 @yabawock Rspec renamed to RSpec (since 2.0.0.beta.9)
yabawock authored
55 RSpec::Core::RakeTask.new('spec') do |t|
b77e11a @yabawock Make Rakefile compatible with rails2 & rails3
yabawock authored
56 t.pattern = FileList['spec/**/*_spec.rb']
57 end
58
59 desc 'Test the formtastic plugin with specdoc formatting and colors'
4b3bb60 @yabawock Rspec renamed to RSpec (since 2.0.0.beta.9)
yabawock authored
60 RSpec::Core::RakeTask.new('specdoc') do |t|
b77e11a @yabawock Make Rakefile compatible with rails2 & rails3
yabawock authored
61 t.pattern = FileList['spec/**/*_spec.rb']
62 end
63
64 desc "Run all examples with RCov"
4b3bb60 @yabawock Rspec renamed to RSpec (since 2.0.0.beta.9)
yabawock authored
65 RSpec::Core::RakeTask.new('examples_with_rcov') do |t|
b77e11a @yabawock Make Rakefile compatible with rails2 & rails3
yabawock authored
66 t.pattern = FileList['spec/**/*_spec.rb']
67 t.rcov = true
68 t.rcov_opts = ['--exclude', 'spec,Library']
69 end
70 end
Something went wrong with that request. Please try again.