Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 104 lines (86 sloc) 3.513 kB
2af75fb @jasonm Making sure Clearance is happy with 1.9
jasonm authored
1 # encoding: utf-8
2
1c6eee9 @technicalpickles Added Rakefile.
technicalpickles authored
3 require 'rake'
4 require 'rake/testtask'
c5d14a6 @eugenebolshakov Adedd rake task to run cucumber stories
eugenebolshakov authored
5 require 'cucumber/rake/task'
4e276c6 @croaky changing generators to require "test_helper" instead of the old File.…
croaky authored
6
34904e5 @mike-burns Test the generators by generating the test app from it, then running …
mike-burns authored
7 namespace :test do
cd85f72 @croaky added clearance_views generator. by default, creates formtastic views…
croaky authored
8 Rake::TestTask.new(:basic => ["generator:cleanup",
9 "generator:clearance",
10 "generator:clearance_features"]) do |task|
11 task.libs << "lib"
12 task.libs << "test"
13 task.pattern = "test/**/*_test.rb"
14 task.verbose = false
15 end
16
17 Rake::TestTask.new(:views => ["generator:clearance_views"]) do |task|
c33d480 @croaky formatting & whitespace
croaky authored
18 task.libs << "lib"
f3ccfd7 @jferris Moved tests out of the lib directory
jferris authored
19 task.libs << "test"
c33d480 @croaky formatting & whitespace
croaky authored
20 task.pattern = "test/**/*_test.rb"
5dd11f4 @croaky moving to shoulda_macros
croaky authored
21 task.verbose = false
34904e5 @mike-burns Test the generators by generating the test app from it, then running …
mike-burns authored
22 end
65f22b9 @qrush Cleaning up some whitespace issues
qrush authored
23
c5d14a6 @eugenebolshakov Adedd rake task to run cucumber stories
eugenebolshakov authored
24 Cucumber::Rake::Task.new(:features) do |t|
c33d480 @croaky formatting & whitespace
croaky authored
25 t.cucumber_opts = "--format progress"
26 t.feature_pattern = "test/rails_root/features/*.feature"
65f22b9 @qrush Cleaning up some whitespace issues
qrush authored
27 end
cd85f72 @croaky added clearance_views generator. by default, creates formtastic views…
croaky authored
28
29 Cucumber::Rake::Task.new(:features_for_views) do |t|
30 t.cucumber_opts = "--format progress"
31 t.feature_pattern = "test/rails_root/features/*.feature"
32 end
f378286 @croaky adding default rake task so runcoderun can run ... code
croaky authored
33 end
7f1e7f5 @mike-burns reduce dependencies
mike-burns authored
34
cd85f72 @croaky added clearance_views generator. by default, creates formtastic views…
croaky authored
35 generators = %w(clearance clearance_features clearance_views)
bcc61fe @eugenebolshakov Modified rakefile to run clearance_stories generator
eugenebolshakov authored
36
a9cc68a @mike-burns Revert "Remove generators, since they're untested"
mike-burns authored
37 namespace :generator do
e0f90c1 @eugenebolshakov Added migration templates to the generator and some handling in case …
eugenebolshakov authored
38 desc "Cleans up the test app before running the generator"
39 task :cleanup do
bcc61fe @eugenebolshakov Modified rakefile to run clearance_stories generator
eugenebolshakov authored
40 generators.each do |generator|
41 FileList["generators/#{generator}/templates/**/*.*"].each do |each|
42 file = "test/rails_root/#{each.gsub("generators/#{generator}/templates/",'')}"
43 File.delete(file) if File.exists?(file)
65f22b9 @qrush Cleaning up some whitespace issues
qrush authored
44 end
9f22a36 @mike-burns Remove Jewler, clean up the test generator
mike-burns authored
45 end
65f22b9 @qrush Cleaning up some whitespace issues
qrush authored
46
0a9068f @eugenebolshakov Adedd rake task to run cucumber stories
eugenebolshakov authored
47 FileList["test/rails_root/db/**/*"].each do |each|
48 FileUtils.rm_rf(each)
49 end
cd85f72 @croaky added clearance_views generator. by default, creates formtastic views…
croaky authored
50
8220e12 @eugenebolshakov Generator now automatically adds lines to ApplicationController and U…
eugenebolshakov authored
51 FileUtils.rm_rf("test/rails_root/vendor/plugins/clearance")
02bb2fe @jferris Moved the confirmations_controller into the app directory
jferris authored
52 FileUtils.mkdir_p("test/rails_root/vendor/plugins")
53 clearance_root = File.expand_path(File.dirname(__FILE__))
54 system("ln -s #{clearance_root} test/rails_root/vendor/plugins/clearance")
cd85f72 @croaky added clearance_views generator. by default, creates formtastic views…
croaky authored
55
56 FileUtils.rm_rf("test/rails_root/app/views/passwords")
57 FileUtils.rm_rf("test/rails_root/app/views/sessions")
58 FileUtils.rm_rf("test/rails_root/app/views/users")
e0f90c1 @eugenebolshakov Added migration templates to the generator and some handling in case …
eugenebolshakov authored
59 end
65f22b9 @qrush Cleaning up some whitespace issues
qrush authored
60
cd85f72 @croaky added clearance_views generator. by default, creates formtastic views…
croaky authored
61 desc "Run the clearance generator"
62 task :clearance do
63 system "cd test/rails_root && ./script/generate clearance && rake db:migrate db:test:prepare"
64 end
65
66 desc "Run the clearance features generator"
67 task :clearance_features do
68 system "cd test/rails_root && ./script/generate clearance_features"
69 end
70
71 desc "Run the clearance views generator"
72 task :clearance_views do
73 system "cd test/rails_root && ./script/generate clearance_views"
34904e5 @mike-burns Test the generators by generating the test app from it, then running …
mike-burns authored
74 end
a9cc68a @mike-burns Revert "Remove generators, since they're untested"
mike-burns authored
75 end
e0c1747 @croaky altering Rakefile for easier gemspec bumping
croaky authored
76
77 desc "Run the test suite"
cd85f72 @croaky added clearance_views generator. by default, creates formtastic views…
croaky authored
78 task :default => ['test:basic', 'test:features',
79 'test:views', 'test:features_for_views']
9f22a36 @mike-burns Remove Jewler, clean up the test generator
mike-burns authored
80
5dd11f4 @croaky moving to shoulda_macros
croaky authored
81 gem_spec = Gem::Specification.new do |gem_spec|
a0d434d @croaky bumping gemspec to 0.3.9
croaky authored
82 gem_spec.name = "clearance"
df4afe9 @croaky bumping the gem to 0.6.9.
croaky authored
83 gem_spec.version = "0.6.9"
2319f3b @croaky updating gemspec for 0.6.1 which failed on github (probably due to a …
croaky authored
84 gem_spec.summary = "Rails authentication with email & password."
a0d434d @croaky bumping gemspec to 0.3.9
croaky authored
85 gem_spec.email = "support@thoughtbot.com"
86 gem_spec.homepage = "http://github.com/thoughtbot/clearance"
2319f3b @croaky updating gemspec for 0.6.1 which failed on github (probably due to a …
croaky authored
87 gem_spec.description = "Rails authentication with email & password."
88 gem_spec.authors = ["Dan Croak", "Mike Burns", "Jason Morrison",
89 "Joe Ferris", "Eugene Bolshakov", "Nick Quaranto",
90 "Josh Nichols", "Mike Breen", "Marcel Görner",
91 "Bence Nagy", "Ben Mabey", "Eloy Duran",
ccc7d98 @croaky updating generator README with one fewer instruction now that Clearan…
croaky authored
92 "Tim Pope", "Mihai Anca", "Mark Cornick",
93 "Shay Arnett"]
b947402 @qrush Updating gemspec for 0.6.0
qrush authored
94 gem_spec.files = FileList["[A-Z]*", "{app,config,generators,lib,shoulda_macros,rails}/**/*"]
b2eb349 @jferris Fixing some gem issues
jferris authored
95 end
96
97 desc "Generate a gemspec file"
98 task :gemspec do
5dd11f4 @croaky moving to shoulda_macros
croaky authored
99 File.open("#{gem_spec.name}.gemspec", 'w') do |f|
100 f.write gem_spec.to_yaml
b2eb349 @jferris Fixing some gem issues
jferris authored
101 end
e0c1747 @croaky altering Rakefile for easier gemspec bumping
croaky authored
102 end
2a3ca7b @croaky removing public_context in tests as an example for Karel on the maili…
croaky authored
103
Something went wrong with that request. Please try again.