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 +5 -1
- data/Rakefile +1 -1
- data/Upgrade.txt +8 -1
- data/generators/rspec/templates/rspec.rake +129 -113
- data/lib/spec/rails/version.rb +1 -1
- data/rspec-rails.gemspec +5 -5
- metadata +3 -3
data/History.txt
CHANGED
@@ -1,4 +1,6 @@
|
|
1
|
-
===
|
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.
|
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
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
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
|
-
|
26
|
-
|
53
|
+
task :default => :spec
|
54
|
+
task :stats => "spec:statsetup"
|
27
55
|
|
28
|
-
|
29
|
-
|
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
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
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
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
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
|
-
|
52
|
-
|
53
|
-
|
54
|
-
t.
|
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
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
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
|
-
|
66
|
-
|
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
|
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
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
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
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
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
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
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
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
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
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
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
|
data/lib/spec/rails/version.rb
CHANGED
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.
|
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.
|
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.
|
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.
|
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.
|
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.
|
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.
|
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.
|
237
|
+
summary: rspec-rails 1.1.99.4
|
238
238
|
test_files: []
|
239
239
|
|