dchelimsky-rspec-rails 1.1.99.3 → 1.1.99.4

Sign up to get free protection for your applications and to get access to all the features.
data/History.txt CHANGED
@@ -1,4 +1,6 @@
1
- === Maintenance
1
+ === Version 1.1.99.4 (in git)
2
+
3
+ IMPORTANT: See Upgrade.txt for information about upgrading to rspec-rails-1.1.99.4
2
4
 
3
5
  IMPORTANT: This release includes the following backwards-compatibility-breaking changes.
4
6
 
@@ -32,6 +34,8 @@ IMPORTANT: This release includes the following backwards-compatibility-breaking
32
34
  * you no longer *have* to load ActionMailer to get specs to run. Closes #650.
33
35
  * query_params are now parsed by Rack::Utils.parse_query in redirect_to matcher. Closes #684.
34
36
  * cleaned up spec_server (there was a bunch of pre-rails 2.0 material). Closes #685.
37
+ * rspec's rake tasks are not loaded when running "rake gems" or any of its subtasks
38
+ * only warn when rspec is not installed when trying to invoke an rspec rake task
35
39
 
36
40
  === Version 1.1.12 / 2009-01-11
37
41
 
data/Rakefile CHANGED
@@ -20,7 +20,7 @@ Hoe.new('rspec-rails', Spec::Rails::VERSION::STRING) do |p|
20
20
  p.description = "Behaviour Driven Development for Ruby on Rails."
21
21
  p.rubyforge_name = 'rspec'
22
22
  p.developer('RSpec Development Team', 'rspec-devel@rubyforge.org')
23
- p.extra_deps = [["dchelimsky-rspec","1.1.99.3"],["rack",">=0.4.0"]]
23
+ p.extra_deps = [["dchelimsky-rspec","1.1.99.4"],["rack",">=0.4.0"]]
24
24
  p.extra_dev_deps = [["cucumber",">= 0.1.13"]]
25
25
  p.remote_rdoc_dir = "rspec-rails/#{Spec::Rails::VERSION::STRING}"
26
26
  end
data/Upgrade.txt CHANGED
@@ -1,4 +1,11 @@
1
- === Upgrade to rspec-rails ????
1
+ === Upgrade to rspec-rails-1.1.99.4
2
+
3
+ == update generated files
4
+
5
+ Be sure to run "script/generate rspec" and allow the following files to be overwritten:
6
+
7
+ * lib/tasks/rspec.rake
8
+ * script/spec_server
2
9
 
3
10
  == route_for
4
11
 
@@ -14,147 +14,163 @@ elsif File.exist?(rspec_plugin_dir)
14
14
  $LOAD_PATH.unshift("#{rspec_plugin_dir}/lib")
15
15
  end
16
16
 
17
+ # Don't load rspec if running "rake gems:*"
18
+ unless ARGV.any? {|a| a =~ /^gems/}
19
+
17
20
  begin
18
21
  require 'spec/rake/spectask'
19
- Rake.application.instance_variable_get('@tasks').delete('default')
20
-
21
- spec_prereq = File.exist?(File.join(RAILS_ROOT, 'config', 'database.yml')) ? "db:test:prepare" : :noop
22
- task :noop do
22
+ rescue MissingSourceFile
23
+ module Spec
24
+ module Rake
25
+ class SpecTask
26
+ def initialize(name)
27
+ task name do
28
+ # if rspec-rails is a configured gem, this will output helpful material and exit ...
29
+ require File.expand_path(File.dirname(__FILE__) + "/../../config/environment")
30
+
31
+ # ... otherwise, do this:
32
+ raise <<-MSG
33
+
34
+ #{"*" * 80}
35
+ * You are trying to run an rspec rake task defined in
36
+ * #{__FILE__},
37
+ * but rspec can not be found in vendor/gems, vendor/plugins or system gems.
38
+ #{"*" * 80}
39
+ MSG
40
+ end
41
+ end
42
+ end
43
+ end
23
44
  end
45
+ end
46
+
47
+ Rake.application.instance_variable_get('@tasks').delete('default')
48
+
49
+ spec_prereq = File.exist?(File.join(RAILS_ROOT, 'config', 'database.yml')) ? "db:test:prepare" : :noop
50
+ task :noop do
51
+ end
24
52
 
25
- task :default => :spec
26
- task :stats => "spec:statsetup"
53
+ task :default => :spec
54
+ task :stats => "spec:statsetup"
27
55
 
28
- desc "Run all specs in spec directory (excluding plugin specs)"
29
- Spec::Rake::SpecTask.new(:spec => spec_prereq) do |t|
56
+ desc "Run all specs in spec directory (excluding plugin specs)"
57
+ Spec::Rake::SpecTask.new(:spec => spec_prereq) do |t|
58
+ t.spec_opts = ['--options', "\"#{RAILS_ROOT}/spec/spec.opts\""]
59
+ t.spec_files = FileList['spec/**/*/*_spec.rb']
60
+ end
61
+
62
+ namespace :spec do
63
+ desc "Run all specs in spec directory with RCov (excluding plugin specs)"
64
+ Spec::Rake::SpecTask.new(:rcov) do |t|
30
65
  t.spec_opts = ['--options', "\"#{RAILS_ROOT}/spec/spec.opts\""]
31
66
  t.spec_files = FileList['spec/**/*/*_spec.rb']
67
+ t.rcov = true
68
+ t.rcov_opts = lambda do
69
+ IO.readlines("#{RAILS_ROOT}/spec/rcov.opts").map {|l| l.chomp.split " "}.flatten
70
+ end
32
71
  end
33
72
 
34
- namespace :spec do
35
- desc "Run all specs in spec directory with RCov (excluding plugin specs)"
36
- Spec::Rake::SpecTask.new(:rcov) do |t|
37
- t.spec_opts = ['--options', "\"#{RAILS_ROOT}/spec/spec.opts\""]
38
- t.spec_files = FileList['spec/**/*/*_spec.rb']
39
- t.rcov = true
40
- t.rcov_opts = lambda do
41
- IO.readlines("#{RAILS_ROOT}/spec/rcov.opts").map {|l| l.chomp.split " "}.flatten
42
- end
43
- end
73
+ desc "Print Specdoc for all specs (excluding plugin specs)"
74
+ Spec::Rake::SpecTask.new(:doc) do |t|
75
+ t.spec_opts = ["--format", "specdoc", "--dry-run"]
76
+ t.spec_files = FileList['spec/**/*/*_spec.rb']
77
+ end
44
78
 
45
- desc "Print Specdoc for all specs (excluding plugin specs)"
46
- Spec::Rake::SpecTask.new(:doc) do |t|
47
- t.spec_opts = ["--format", "specdoc", "--dry-run"]
48
- t.spec_files = FileList['spec/**/*/*_spec.rb']
49
- end
79
+ desc "Print Specdoc for all plugin examples"
80
+ Spec::Rake::SpecTask.new(:plugin_doc) do |t|
81
+ t.spec_opts = ["--format", "specdoc", "--dry-run"]
82
+ t.spec_files = FileList['vendor/plugins/**/spec/**/*/*_spec.rb'].exclude('vendor/plugins/rspec/*')
83
+ end
50
84
 
51
- desc "Print Specdoc for all plugin examples"
52
- Spec::Rake::SpecTask.new(:plugin_doc) do |t|
53
- t.spec_opts = ["--format", "specdoc", "--dry-run"]
54
- t.spec_files = FileList['vendor/plugins/**/spec/**/*/*_spec.rb'].exclude('vendor/plugins/rspec/*')
85
+ [:models, :controllers, :views, :helpers, :lib].each do |sub|
86
+ desc "Run the code examples in spec/#{sub}"
87
+ Spec::Rake::SpecTask.new(sub => spec_prereq) do |t|
88
+ t.spec_opts = ['--options', "\"#{RAILS_ROOT}/spec/spec.opts\""]
89
+ t.spec_files = FileList["spec/#{sub}/**/*_spec.rb"]
55
90
  end
91
+ end
56
92
 
57
- [:models, :controllers, :views, :helpers, :lib].each do |sub|
58
- desc "Run the code examples in spec/#{sub}"
59
- Spec::Rake::SpecTask.new(sub => spec_prereq) do |t|
60
- t.spec_opts = ['--options', "\"#{RAILS_ROOT}/spec/spec.opts\""]
61
- t.spec_files = FileList["spec/#{sub}/**/*_spec.rb"]
62
- end
63
- end
93
+ desc "Run the code examples in vendor/plugins (except RSpec's own)"
94
+ Spec::Rake::SpecTask.new(:plugins => spec_prereq) do |t|
95
+ t.spec_opts = ['--options', "\"#{RAILS_ROOT}/spec/spec.opts\""]
96
+ t.spec_files = FileList['vendor/plugins/**/spec/**/*/*_spec.rb'].exclude('vendor/plugins/rspec/*').exclude("vendor/plugins/rspec-rails/*")
97
+ end
64
98
 
65
- desc "Run the code examples in vendor/plugins (except RSpec's own)"
66
- Spec::Rake::SpecTask.new(:plugins => spec_prereq) do |t|
99
+ namespace :plugins do
100
+ desc "Runs the examples for rspec_on_rails"
101
+ Spec::Rake::SpecTask.new(:rspec_on_rails) do |t|
67
102
  t.spec_opts = ['--options', "\"#{RAILS_ROOT}/spec/spec.opts\""]
68
- t.spec_files = FileList['vendor/plugins/**/spec/**/*/*_spec.rb'].exclude('vendor/plugins/rspec/*').exclude("vendor/plugins/rspec-rails/*")
69
- end
70
-
71
- namespace :plugins do
72
- desc "Runs the examples for rspec_on_rails"
73
- Spec::Rake::SpecTask.new(:rspec_on_rails) do |t|
74
- t.spec_opts = ['--options', "\"#{RAILS_ROOT}/spec/spec.opts\""]
75
- t.spec_files = FileList['vendor/plugins/rspec-rails/spec/**/*/*_spec.rb']
76
- end
103
+ t.spec_files = FileList['vendor/plugins/rspec-rails/spec/**/*/*_spec.rb']
77
104
  end
105
+ end
78
106
 
79
- # Setup specs for stats
80
- task :statsetup do
81
- require 'code_statistics'
82
- ::STATS_DIRECTORIES << %w(Model\ specs spec/models) if File.exist?('spec/models')
83
- ::STATS_DIRECTORIES << %w(View\ specs spec/views) if File.exist?('spec/views')
84
- ::STATS_DIRECTORIES << %w(Controller\ specs spec/controllers) if File.exist?('spec/controllers')
85
- ::STATS_DIRECTORIES << %w(Helper\ specs spec/helpers) if File.exist?('spec/helpers')
86
- ::STATS_DIRECTORIES << %w(Library\ specs spec/lib) if File.exist?('spec/lib')
87
- ::CodeStatistics::TEST_TYPES << "Model specs" if File.exist?('spec/models')
88
- ::CodeStatistics::TEST_TYPES << "View specs" if File.exist?('spec/views')
89
- ::CodeStatistics::TEST_TYPES << "Controller specs" if File.exist?('spec/controllers')
90
- ::CodeStatistics::TEST_TYPES << "Helper specs" if File.exist?('spec/helpers')
91
- ::CodeStatistics::TEST_TYPES << "Library specs" if File.exist?('spec/lib')
92
- ::STATS_DIRECTORIES.delete_if {|a| a[0] =~ /test/}
93
- end
107
+ # Setup specs for stats
108
+ task :statsetup do
109
+ require 'code_statistics'
110
+ ::STATS_DIRECTORIES << %w(Model\ specs spec/models) if File.exist?('spec/models')
111
+ ::STATS_DIRECTORIES << %w(View\ specs spec/views) if File.exist?('spec/views')
112
+ ::STATS_DIRECTORIES << %w(Controller\ specs spec/controllers) if File.exist?('spec/controllers')
113
+ ::STATS_DIRECTORIES << %w(Helper\ specs spec/helpers) if File.exist?('spec/helpers')
114
+ ::STATS_DIRECTORIES << %w(Library\ specs spec/lib) if File.exist?('spec/lib')
115
+ ::CodeStatistics::TEST_TYPES << "Model specs" if File.exist?('spec/models')
116
+ ::CodeStatistics::TEST_TYPES << "View specs" if File.exist?('spec/views')
117
+ ::CodeStatistics::TEST_TYPES << "Controller specs" if File.exist?('spec/controllers')
118
+ ::CodeStatistics::TEST_TYPES << "Helper specs" if File.exist?('spec/helpers')
119
+ ::CodeStatistics::TEST_TYPES << "Library specs" if File.exist?('spec/lib')
120
+ ::STATS_DIRECTORIES.delete_if {|a| a[0] =~ /test/}
121
+ end
94
122
 
95
- namespace :db do
96
- namespace :fixtures do
97
- desc "Load fixtures (from spec/fixtures) into the current environment's database. Load specific fixtures using FIXTURES=x,y. Load from subdirectory in test/fixtures using FIXTURES_DIR=z."
98
- task :load => :environment do
99
- ActiveRecord::Base.establish_connection(Rails.env)
100
- base_dir = File.join(Rails.root, 'spec', 'fixtures')
101
- fixtures_dir = ENV['FIXTURES_DIR'] ? File.join(base_dir, ENV['FIXTURES_DIR']) : base_dir
102
-
103
- (ENV['FIXTURES'] ? ENV['FIXTURES'].split(/,/).map {|f| File.join(fixtures_dir, f) } : Dir.glob(File.join(fixtures_dir, '*.{yml,csv}'))).each do |fixture_file|
104
- Fixtures.create_fixtures(File.dirname(fixture_file), File.basename(fixture_file, '.*'))
105
- end
123
+ namespace :db do
124
+ namespace :fixtures do
125
+ desc "Load fixtures (from spec/fixtures) into the current environment's database. Load specific fixtures using FIXTURES=x,y. Load from subdirectory in test/fixtures using FIXTURES_DIR=z."
126
+ task :load => :environment do
127
+ ActiveRecord::Base.establish_connection(Rails.env)
128
+ base_dir = File.join(Rails.root, 'spec', 'fixtures')
129
+ fixtures_dir = ENV['FIXTURES_DIR'] ? File.join(base_dir, ENV['FIXTURES_DIR']) : base_dir
130
+
131
+ (ENV['FIXTURES'] ? ENV['FIXTURES'].split(/,/).map {|f| File.join(fixtures_dir, f) } : Dir.glob(File.join(fixtures_dir, '*.{yml,csv}'))).each do |fixture_file|
132
+ Fixtures.create_fixtures(File.dirname(fixture_file), File.basename(fixture_file, '.*'))
106
133
  end
107
134
  end
108
135
  end
136
+ end
109
137
 
110
- namespace :server do
111
- daemonized_server_pid = File.expand_path("#{RAILS_ROOT}/tmp/spec_server.pid")
112
-
113
- desc "start spec_server."
114
- task :start do
115
- if File.exist?(daemonized_server_pid)
116
- $stderr.puts "spec_server is already running."
117
- else
118
- $stderr.puts %Q{Starting up spec_server ...}
119
- system("ruby", "script/spec_server", "--daemon", "--pid", daemonized_server_pid)
120
- end
138
+ namespace :server do
139
+ daemonized_server_pid = File.expand_path("#{RAILS_ROOT}/tmp/spec_server.pid")
140
+
141
+ desc "start spec_server."
142
+ task :start do
143
+ if File.exist?(daemonized_server_pid)
144
+ $stderr.puts "spec_server is already running."
145
+ else
146
+ $stderr.puts %Q{Starting up spec_server ...}
147
+ system("ruby", "script/spec_server", "--daemon", "--pid", daemonized_server_pid)
121
148
  end
149
+ end
122
150
 
123
- desc "stop spec_server."
124
- task :stop do
125
- unless File.exist?(daemonized_server_pid)
126
- $stderr.puts "No server running."
127
- else
128
- $stderr.puts "Shutting down spec_server ..."
129
- system("kill", "-s", "TERM", File.read(daemonized_server_pid).strip) &&
130
- File.delete(daemonized_server_pid)
131
- end
151
+ desc "stop spec_server."
152
+ task :stop do
153
+ unless File.exist?(daemonized_server_pid)
154
+ $stderr.puts "No server running."
155
+ else
156
+ $stderr.puts "Shutting down spec_server ..."
157
+ system("kill", "-s", "TERM", File.read(daemonized_server_pid).strip) &&
158
+ File.delete(daemonized_server_pid)
132
159
  end
160
+ end
133
161
 
134
- desc "restart spec_server."
135
- task :restart => [:stop, :start]
136
-
137
- desc "check if spec server is running"
138
- task :status do
139
- if File.exist?(daemonized_server_pid)
140
- $stderr.puts %Q{spec_server is running (PID: #{File.read(daemonized_server_pid).gsub("\n","")})}
141
- else
142
- $stderr.puts "No server running."
143
- end
162
+ desc "restart spec_server."
163
+ task :restart => [:stop, :start]
164
+
165
+ desc "check if spec server is running"
166
+ task :status do
167
+ if File.exist?(daemonized_server_pid)
168
+ $stderr.puts %Q{spec_server is running (PID: #{File.read(daemonized_server_pid).gsub("\n","")})}
169
+ else
170
+ $stderr.puts "No server running."
144
171
  end
145
172
  end
146
173
  end
147
- rescue MissingSourceFile
148
- # if rspec-rails is a configured gem, this will output helpful material and exit ...
149
- require File.expand_path(File.dirname(__FILE__) + "/../../config/environment")
150
-
151
- # ... otherwise, do this:
152
- raise <<-MSG
153
-
154
- You have rspec rake tasks installed in
155
- #{__FILE__},
156
- but rspec can not be found in vendor/gems, vendor/plugins or on the system.
157
-
158
- MSG
159
174
  end
160
175
 
176
+ end
@@ -5,7 +5,7 @@ module Spec
5
5
  MAJOR = 1
6
6
  MINOR = 1
7
7
  TINY = 99
8
- MINESCULE = 3
8
+ MINESCULE = 4
9
9
 
10
10
  STRING = [MAJOR, MINOR, TINY, MINESCULE].compact.join('.')
11
11
 
data/rspec-rails.gemspec CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = %q{rspec-rails}
5
- s.version = "1.1.99.3"
5
+ s.version = "1.1.99.4"
6
6
 
7
7
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
8
8
  s.authors = ["RSpec Development Team"]
@@ -17,23 +17,23 @@ Gem::Specification.new do |s|
17
17
  s.require_paths = ["lib"]
18
18
  s.rubyforge_project = %q{rspec}
19
19
  s.rubygems_version = %q{1.3.1}
20
- s.summary = %q{rspec-rails 1.1.99.3}
20
+ s.summary = %q{rspec-rails 1.1.99.4}
21
21
 
22
22
  if s.respond_to? :specification_version then
23
23
  current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
24
24
  s.specification_version = 2
25
25
 
26
26
  if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
27
- s.add_runtime_dependency(%q<dchelimsky-rspec>, ["= 1.1.99.3"])
27
+ s.add_runtime_dependency(%q<dchelimsky-rspec>, ["= 1.1.99.4"])
28
28
  s.add_runtime_dependency(%q<rack>, [">= 0.4.0"])
29
29
  s.add_development_dependency(%q<cucumber>, [">= 0.1.13"])
30
30
  s.add_development_dependency(%q<hoe>, [">= 1.8.3"])
31
31
  else
32
- s.add_dependency(%q<dchelimsky-rspec>, ["= 1.1.99.3"])
32
+ s.add_dependency(%q<dchelimsky-rspec>, ["= 1.1.99.4"])
33
33
  s.add_dependency(%q<rack>, [">= 0.4.0"])
34
34
  end
35
35
  else
36
- s.add_dependency(%q<dchelimsky-rspec>, ["= 1.1.99.3"])
36
+ s.add_dependency(%q<dchelimsky-rspec>, ["= 1.1.99.4"])
37
37
  s.add_dependency(%q<rack>, [">= 0.4.0"])
38
38
  end
39
39
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dchelimsky-rspec-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.99.3
4
+ version: 1.1.99.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - RSpec Development Team
@@ -19,7 +19,7 @@ dependencies:
19
19
  requirements:
20
20
  - - "="
21
21
  - !ruby/object:Gem::Version
22
- version: 1.1.99.3
22
+ version: 1.1.99.4
23
23
  version:
24
24
  - !ruby/object:Gem::Dependency
25
25
  name: rack
@@ -234,6 +234,6 @@ rubyforge_project: rspec
234
234
  rubygems_version: 1.2.0
235
235
  signing_key:
236
236
  specification_version: 2
237
- summary: rspec-rails 1.1.99.3
237
+ summary: rspec-rails 1.1.99.4
238
238
  test_files: []
239
239