Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 81 lines (66 sloc) 2.611 kb
74169ed @mike-burns Basic testing infrastructure
mike-burns authored
1 # encoding: utf-8
2
3 require 'rake'
4 require 'rake/testtask'
5 require 'cucumber/rake/task'
6
7 namespace :test do
8 Rake::TestTask.new(:basic => ["link",
9 "generator:clearance_twitter"]) do |task|
10 task.libs << "lib"
11 task.libs << "test"
12 task.test_files = FileList['test/**/*_test.rb'] - FileList['test/rails_root/**/*_test.rb']
13 task.verbose = false
14 end
15
16 Cucumber::Rake::Task.new(:features => ["link",
17 "generator:clearance_twitter",
18 "generator:clearance_twitter_features"]) do |t|
af3ce68 @jasonm rake cucumber is pretty instead of progress
jasonm authored
19 t.cucumber_opts = "--format pretty"
20 t.profile = 'features'
21 end
22
23 Cucumber::Rake::Task.new(:wip => ["link",
24 "generator:clearance_twitter",
25 "generator:clearance_twitter_features"]) do |t|
26 t.cucumber_opts = "--format pretty --tags @wip"
74169ed @mike-burns Basic testing infrastructure
mike-burns authored
27 t.profile = 'features'
28 end
29 end
30
31 generators = %w(clearance_twitter clearance_twitter_facebook)
32
33 desc "Cleaned up generated files"
34 task :cleanup do
35 FileList["test/rails_root/db/**/*twitter*"].each do |each|
36 FileUtils.rm_rf(each)
37 end
38 FileUtils.rm_rf("test/rails_root/vendor/plugins/clearance_twitter")
39 FileUtils.rm_rf("test/rails_root/db/schema.rb")
40 FileList["test/rails_root/db/*.sqlite3"].each do |each|
41 FileUtils.rm_rf(each)
42 end
43 end
44
45 desc "Links the plugin into the test rails_root"
46 task :link => :cleanup do
47 clearance_twitter_root = File.expand_path(File.dirname(__FILE__))
48 system("ln -s #{clearance_twitter_root} test/rails_root/vendor/plugins/clearance_twitter")
49 end
50
51 namespace :generator do
52 desc "Run the clearance_twitter generator"
53 task :clearance_twitter do
54 system "cd test/rails_root && ./script/generate clearance_twitter -f && rake db:migrate db:test:prepare"
55 end
56
57 desc "Run the clearance_twitter features generator"
58 task :clearance_twitter_features do
59 system "cd test/rails_root && ./script/generate clearance_twitter_features -f"
60 end
61 end
62
63 desc "Run the test suite"
64 task :default => ['test:basic', 'test:features']
65
66 require 'jeweler'
67
68 Jeweler::Tasks.new do |gem|
69 gem.name = "clearance-twitter"
70 gem.summary = "Twitter engine for Clearance"
71 gem.description = "Twitter engine for Clearance"
72 gem.email = "support@thoughtbot.com"
73 gem.homepage = "http://github.com/thoughtbot/clearance-twitter"
74 gem.authors = ["thoughtbot, inc."]
75 gem.files = FileList["[A-Z]*", "{app,config,generators,lib,rails}/**/*"]
76
77 gem.add_dependency "clearance", ">= 0.8.6"
78 end
79
80 Jeweler::GemcutterTasks.new
Something went wrong with that request. Please try again.