baldwin 0.2.1 → 0.2.2

Sign up to get free protection for your applications and to get access to all the features.
data/Rakefile CHANGED
@@ -1,2 +1,5 @@
1
1
  #!/usr/bin/env rake
2
2
  require 'bundler/gem_tasks'
3
+ require 'rspec/core/rake_task'
4
+
5
+ RSpec::Core::RakeTask.new :spec
data/baldwin.gemspec CHANGED
@@ -19,4 +19,6 @@ Gem::Specification.new do |gem|
19
19
  gem.add_dependency 'rspec-rails', '>= 2.10.0'
20
20
  gem.add_dependency 'appraisal', '>= 0.4.1'
21
21
  gem.add_dependency 'thor', '>= 0.14.6'
22
+
23
+ gem.add_development_dependency 'rspec', '2.10.0'
22
24
  end
@@ -8,16 +8,12 @@ namespace :baldwin do
8
8
 
9
9
  desc "Set up current environment variables"
10
10
  task :env do
11
- require 'rails/version'
12
- ENV[ 'BALDWIN_RAILS_NAME' ] = "rails-#{Rails::VERSION::STRING}"
13
- ENV[ 'BALDWIN_RAILS_PATH' ] = "spec/rails/#{ENV[ 'BALDWIN_RAILS_NAME' ]}"
11
+ Baldwin.env!
14
12
  end
15
13
 
16
14
  desc "Remove all test rails apps"
17
15
  task :clean => [ :env ] do
18
- Dir[ 'spec/rails/rails-*' ].each do |app|
19
- FileUtils.rm_rf app
20
- end
16
+ Baldwin.apps.each { |app| app.rmdir :force => true }
21
17
  end
22
18
 
23
19
  desc "Create a test rails app if necessary"
@@ -13,14 +13,9 @@ EOS
13
13
  def create_appraisals_file
14
14
  create_file 'Appraisals', <<-EOS
15
15
  # add your rails configurations to test against here, like:
16
- #
17
- # appraise 'rails-3.1.0' do
18
- # gem 'rails', '3.1.0'
19
- # end
20
- # appraise 'rails-3.2.0' do
21
- # gem 'rails', '3.2.0'
22
- # end
23
- #
16
+ appraise 'rails-3.1.0' do
17
+ gem 'rails', '3.1.0'
18
+ end
24
19
  # see https://github.com/thoughtbot/appraisal for more info
25
20
  EOS
26
21
  end
@@ -28,7 +23,7 @@ EOS
28
23
  def add_baldwin_setup_to_spec_helper
29
24
  create_file 'spec/spec_helper.rb', <<-EOS
30
25
  require 'baldwin/setup'
31
- # require test dependencies *after* baldwin/setup
26
+ require 'rspec/rails'
32
27
  EOS
33
28
  end
34
29
 
@@ -1,3 +1,3 @@
1
1
  module Baldwin
2
- VERSION = '0.2.1'
2
+ VERSION = '0.2.2'
3
3
  end
data/lib/baldwin.rb CHANGED
@@ -2,4 +2,24 @@ require 'baldwin/version'
2
2
 
3
3
  module Baldwin
4
4
  autoload :Installer, 'baldwin/installer'
5
+
6
+ RAILS_PATTERN = 'spec/rails/rails-*'
7
+
8
+ def self.env!
9
+ require 'rails/version'
10
+ ENV[ 'BALDWIN_RAILS_NAME' ] = "rails-#{Rails::VERSION::STRING}"
11
+ ENV[ 'BALDWIN_RAILS_PATH' ] = "spec/rails/#{ENV[ 'BALDWIN_RAILS_NAME' ]}"
12
+ end
13
+
14
+ def self.root
15
+ Pathname.new Dir.pwd
16
+ end
17
+
18
+ def self.rails
19
+ Pathname.new ENV[ 'BALDWIN_RAILS_PATH' ]
20
+ end
21
+
22
+ def self.apps
23
+ Dir[ RAILS_PATTERN ]
24
+ end
5
25
  end
@@ -0,0 +1,31 @@
1
+ require 'spec_helper'
2
+
3
+ describe Baldwin do
4
+ before { Baldwin.env! }
5
+
6
+ describe '#env!' do
7
+ it 'should set BALDWIN_RAILS_NAME' do
8
+ ENV[ 'BALDWIN_RAILS_NAME' ].should == "rails-#{Rails::VERSION::STRING}"
9
+ end
10
+ it 'should set BALDWIN_RAILS_PATH' do
11
+ ENV[ 'BALDWIN_RAILS_PATH' ].should == "spec/rails/#{ENV[ 'BALDWIN_RAILS_NAME' ]}"
12
+ end
13
+ end
14
+
15
+ describe '#root' do
16
+ subject { Baldwin.root }
17
+ it { should be_a( Pathname ) }
18
+ its( :to_s ){ should eq( Dir.pwd ) }
19
+ end
20
+
21
+ describe '#rails' do
22
+ subject { Baldwin.rails }
23
+ it { should be_a( Pathname ) }
24
+ its( :to_s ){ should eq( ENV[ 'BALDWIN_RAILS_PATH' ] ) }
25
+ end
26
+
27
+ describe '#apps' do
28
+ subject { Baldwin.apps }
29
+ it { should be_an( Array ) }
30
+ end
31
+ end
@@ -0,0 +1,6 @@
1
+ require 'baldwin'
2
+
3
+ RSpec.configure do |config|
4
+ config.color_enabled = true
5
+ config.formatter = :documentation
6
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: baldwin
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.2.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-06-03 00:00:00.000000000 Z
12
+ date: 2012-06-08 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rails
@@ -75,6 +75,22 @@ dependencies:
75
75
  - - ! '>='
76
76
  - !ruby/object:Gem::Version
77
77
  version: 0.14.6
78
+ - !ruby/object:Gem::Dependency
79
+ name: rspec
80
+ requirement: !ruby/object:Gem::Requirement
81
+ none: false
82
+ requirements:
83
+ - - '='
84
+ - !ruby/object:Gem::Version
85
+ version: 2.10.0
86
+ type: :development
87
+ prerelease: false
88
+ version_requirements: !ruby/object:Gem::Requirement
89
+ none: false
90
+ requirements:
91
+ - - '='
92
+ - !ruby/object:Gem::Version
93
+ version: 2.10.0
78
94
  description: Bootstrap testing your rails 3 engine
79
95
  email:
80
96
  - jeremy.ruppel@gmail.com
@@ -94,6 +110,8 @@ files:
94
110
  - lib/baldwin/rails_template.rb
95
111
  - lib/baldwin/setup.rb
96
112
  - lib/baldwin/version.rb
113
+ - spec/baldwin/paths_spec.rb
114
+ - spec/spec_helper.rb
97
115
  homepage: https://github.com/jeremyruppel/baldwin
98
116
  licenses: []
99
117
  post_install_message:
@@ -118,4 +136,6 @@ rubygems_version: 1.8.19
118
136
  signing_key:
119
137
  specification_version: 3
120
138
  summary: Bootstrap testing your rails 3 engine
121
- test_files: []
139
+ test_files:
140
+ - spec/baldwin/paths_spec.rb
141
+ - spec/spec_helper.rb