dchelimsky-rspec-rails 1.1.11.1 → 1.1.11.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/History.txt +11 -2
- data/Manifest.txt +4 -7
- data/Rakefile +1 -1
- data/features/step_definitions/people.rb +6 -0
- data/features/support/env.rb +11 -0
- data/generators/rspec/templates/rspec.rake +13 -11
- data/generators/rspec_default_values.rb +3 -3
- data/generators/rspec_scaffold/templates/edit_erb_spec.rb +1 -1
- data/generators/rspec_scaffold/templates/index_erb_spec.rb +2 -2
- data/generators/rspec_scaffold/templates/new_erb_spec.rb +1 -1
- data/generators/rspec_scaffold/templates/show_erb_spec.rb +2 -2
- data/lib/spec/rails/example/controller_example_group.rb +10 -0
- data/lib/spec/rails/example/rails_example_group.rb +10 -15
- data/lib/spec/rails/extensions/spec/example/configuration.rb +10 -5
- data/lib/spec/rails/matchers/render_template.rb +11 -1
- data/lib/spec/rails/version.rb +1 -1
- data/lib/spec/rails.rb +6 -1
- data/rspec-rails.gemspec +8 -7
- data/spec/rails/example/configuration_spec.rb +8 -8
- data/spec/rails/example/controller_spec_spec.rb +1 -1
- data/spec/rails/interop/testcase_spec.rb +5 -1
- data/spec/resources/views/view_spec/path_params.html.erb +1 -0
- data/spec/spec_helper.rb +1 -0
- metadata +8 -11
- data/UPGRADE +0 -7
- data/stories/all.rb +0 -10
- data/stories/configuration/stories.rb +0 -5
- data/stories/helper.rb +0 -6
- data/stories/steps/people.rb +0 -8
- data/stories/transactions_should_rollback.rb +0 -25
- /data/{stories/transactions_should_rollback → features/transactions/transactions_should_rollback.feature} +0 -0
data/History.txt
CHANGED
@@ -1,12 +1,21 @@
|
|
1
1
|
=== Maintenance
|
2
2
|
|
3
|
-
*
|
3
|
+
* 2 major enhancements
|
4
4
|
|
5
5
|
* support controller and action path params in view specs (Mike Vincent).
|
6
|
+
* use ActiveSupport::TestCase when available, else Test::Unit::TestCase - supports Rails 1.2.6 (Brandon Keepers). Closes #620.
|
6
7
|
|
7
|
-
*
|
8
|
+
* 3 minor enhancements
|
8
9
|
|
9
10
|
* improve rdoc for render_template (Patch from Andrew Premdas). Fixes #571.
|
11
|
+
* use more liberal globs to allow for specs in symlinked dirs (Martin Luder). Closes #361.
|
12
|
+
* Enable loading fixtures from arbitrary locations (Jacek Becela). Closes #464.
|
13
|
+
|
14
|
+
* 3 bug fixes
|
15
|
+
|
16
|
+
* Attempt to load application_controller before falling back to application (Geoff Garside). Closes #626.
|
17
|
+
* Include _id and reduce quoting of default values in view specs (Steen Lehmann). Closes #598.
|
18
|
+
* Record calls to render and check rendered[:template] and rendered[:partial] for edge rails (> v2.2.2). Closes #633.
|
10
19
|
|
11
20
|
=== Version 1.1.11 / 2008-10-24
|
12
21
|
|
data/Manifest.txt
CHANGED
@@ -3,7 +3,9 @@ License.txt
|
|
3
3
|
Manifest.txt
|
4
4
|
README.txt
|
5
5
|
Rakefile
|
6
|
-
|
6
|
+
features/step_definitions/people.rb
|
7
|
+
features/support/env.rb
|
8
|
+
features/transactions/transactions_should_rollback.feature
|
7
9
|
generators/rspec/CHANGES
|
8
10
|
generators/rspec/rspec_generator.rb
|
9
11
|
generators/rspec/templates/all_stories.rb
|
@@ -148,14 +150,9 @@ spec/resources/views/view_spec/explicit_helper.rhtml
|
|
148
150
|
spec/resources/views/view_spec/foo/show.rhtml
|
149
151
|
spec/resources/views/view_spec/implicit_helper.rhtml
|
150
152
|
spec/resources/views/view_spec/multiple_helpers.rhtml
|
153
|
+
spec/resources/views/view_spec/path_params.html.erb
|
151
154
|
spec/resources/views/view_spec/should_not_receive.rhtml
|
152
155
|
spec/resources/views/view_spec/template_with_partial.rhtml
|
153
156
|
spec/resources/views/view_spec/template_with_partial_using_collection.rhtml
|
154
157
|
spec/resources/views/view_spec/template_with_partial_with_array.rhtml
|
155
158
|
spec/spec_helper.rb
|
156
|
-
stories/all.rb
|
157
|
-
stories/configuration/stories.rb
|
158
|
-
stories/helper.rb
|
159
|
-
stories/steps/people.rb
|
160
|
-
stories/transactions_should_rollback
|
161
|
-
stories/transactions_should_rollback.rb
|
data/Rakefile
CHANGED
@@ -15,7 +15,7 @@ Hoe.new('rspec-rails', Spec::Rails::VERSION::STRING) do |p|
|
|
15
15
|
p.description = "Behaviour Driven Development for Ruby on Rails."
|
16
16
|
p.rubyforge_name = 'rspec'
|
17
17
|
p.developer('RSpec Development Team', 'rspec-devel@rubyforge.org')
|
18
|
-
p.extra_deps = [["rspec","1.1.11.1"]]
|
18
|
+
p.extra_deps = [["rspec","1.1.11.2"],["cucumber",">= 0.1.13"]]
|
19
19
|
p.remote_rdoc_dir = "rspec-rails/#{Spec::Rails::VERSION::STRING}"
|
20
20
|
end
|
21
21
|
|
@@ -0,0 +1,11 @@
|
|
1
|
+
# Sets up the Rails environment for Cucumber
|
2
|
+
ENV["RAILS_ENV"] = "test"
|
3
|
+
require File.expand_path(File.dirname(__FILE__) + '/../../../../../config/environment')
|
4
|
+
require 'cucumber/rails/world'
|
5
|
+
Cucumber::Rails.use_transactional_fixtures
|
6
|
+
|
7
|
+
# require 'webrat/rails'
|
8
|
+
|
9
|
+
# Comment out the next two lines if you're not using RSpec's matchers (should / should_not) in your steps.
|
10
|
+
require 'cucumber/rails/rspec'
|
11
|
+
# require 'webrat/rspec-rails'
|
@@ -21,14 +21,14 @@ begin
|
|
21
21
|
desc "Run all specs in spec directory (excluding plugin specs)"
|
22
22
|
Spec::Rake::SpecTask.new(:spec => spec_prereq) do |t|
|
23
23
|
t.spec_opts = ['--options', "\"#{RAILS_ROOT}/spec/spec.opts\""]
|
24
|
-
t.spec_files = FileList['spec
|
24
|
+
t.spec_files = FileList['spec/**/*/*_spec.rb']
|
25
25
|
end
|
26
26
|
|
27
27
|
namespace :spec do
|
28
28
|
desc "Run all specs in spec directory with RCov (excluding plugin specs)"
|
29
29
|
Spec::Rake::SpecTask.new(:rcov) do |t|
|
30
30
|
t.spec_opts = ['--options', "\"#{RAILS_ROOT}/spec/spec.opts\""]
|
31
|
-
t.spec_files = FileList['spec
|
31
|
+
t.spec_files = FileList['spec/**/*/*_spec.rb']
|
32
32
|
t.rcov = true
|
33
33
|
t.rcov_opts = lambda do
|
34
34
|
IO.readlines("#{RAILS_ROOT}/spec/rcov.opts").map {|l| l.chomp.split " "}.flatten
|
@@ -38,13 +38,13 @@ begin
|
|
38
38
|
desc "Print Specdoc for all specs (excluding plugin specs)"
|
39
39
|
Spec::Rake::SpecTask.new(:doc) do |t|
|
40
40
|
t.spec_opts = ["--format", "specdoc", "--dry-run"]
|
41
|
-
t.spec_files = FileList['spec
|
41
|
+
t.spec_files = FileList['spec/**/*/*_spec.rb']
|
42
42
|
end
|
43
43
|
|
44
44
|
desc "Print Specdoc for all plugin examples"
|
45
45
|
Spec::Rake::SpecTask.new(:plugin_doc) do |t|
|
46
46
|
t.spec_opts = ["--format", "specdoc", "--dry-run"]
|
47
|
-
t.spec_files = FileList['vendor/plugins/**/spec
|
47
|
+
t.spec_files = FileList['vendor/plugins/**/spec/**/*/*_spec.rb'].exclude('vendor/plugins/rspec/*')
|
48
48
|
end
|
49
49
|
|
50
50
|
[:models, :controllers, :views, :helpers, :lib].each do |sub|
|
@@ -58,14 +58,14 @@ begin
|
|
58
58
|
desc "Run the code examples in vendor/plugins (except RSpec's own)"
|
59
59
|
Spec::Rake::SpecTask.new(:plugins => spec_prereq) do |t|
|
60
60
|
t.spec_opts = ['--options', "\"#{RAILS_ROOT}/spec/spec.opts\""]
|
61
|
-
t.spec_files = FileList['vendor/plugins/**/spec
|
61
|
+
t.spec_files = FileList['vendor/plugins/**/spec/**/*/*_spec.rb'].exclude('vendor/plugins/rspec/*').exclude("vendor/plugins/rspec-rails/*")
|
62
62
|
end
|
63
63
|
|
64
64
|
namespace :plugins do
|
65
65
|
desc "Runs the examples for rspec_on_rails"
|
66
66
|
Spec::Rake::SpecTask.new(:rspec_on_rails) do |t|
|
67
67
|
t.spec_opts = ['--options', "\"#{RAILS_ROOT}/spec/spec.opts\""]
|
68
|
-
t.spec_files = FileList['vendor/plugins/rspec-rails/spec
|
68
|
+
t.spec_files = FileList['vendor/plugins/rspec-rails/spec/**/*/*_spec.rb']
|
69
69
|
end
|
70
70
|
end
|
71
71
|
|
@@ -87,12 +87,14 @@ begin
|
|
87
87
|
|
88
88
|
namespace :db do
|
89
89
|
namespace :fixtures do
|
90
|
-
desc "Load fixtures (from spec/fixtures) into the current environment's database. Load specific fixtures using FIXTURES=x,y"
|
90
|
+
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."
|
91
91
|
task :load => :environment do
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
92
|
+
ActiveRecord::Base.establish_connection(Rails.env)
|
93
|
+
base_dir = File.join(Rails.root, 'spec', 'fixtures')
|
94
|
+
fixtures_dir = ENV['FIXTURES_DIR'] ? File.join(base_dir, ENV['FIXTURES_DIR']) : base_dir
|
95
|
+
|
96
|
+
(ENV['FIXTURES'] ? ENV['FIXTURES'].split(/,/).map {|f| File.join(fixtures_dir, f) } : Dir.glob(File.join(fixtures_dir, '*.{yml,csv}'))).each do |fixture_file|
|
97
|
+
Fixtures.create_fixtures(File.dirname(fixture_file), File.basename(fixture_file, '.*'))
|
96
98
|
end
|
97
99
|
end
|
98
100
|
end
|
@@ -3,9 +3,9 @@ module Rails
|
|
3
3
|
class GeneratedAttribute
|
4
4
|
def default_value
|
5
5
|
@default_value ||= case type
|
6
|
-
when :int, :integer then "
|
7
|
-
when :float then "
|
8
|
-
when :decimal then "
|
6
|
+
when :int, :integer then "1"
|
7
|
+
when :float then "1.5"
|
8
|
+
when :decimal then "9.99"
|
9
9
|
when :datetime, :timestamp, :time then "Time.now"
|
10
10
|
when :date then "Date.today"
|
11
11
|
when :string, :text then "\"value for #{@name}\""
|
@@ -1,6 +1,6 @@
|
|
1
1
|
require File.expand_path(File.dirname(__FILE__) + '<%= '/..' * class_nesting_depth %>/../../spec_helper')
|
2
2
|
|
3
|
-
<% output_attributes = attributes.reject{|attribute|
|
3
|
+
<% output_attributes = attributes.reject{|attribute| [:datetime, :timestamp, :time, :date].index(attribute.type) } -%>
|
4
4
|
describe "/<%= table_name %>/edit.<%= default_file_extension %>" do
|
5
5
|
include <%= controller_class_name %>Helper
|
6
6
|
|
@@ -1,6 +1,6 @@
|
|
1
1
|
require File.expand_path(File.dirname(__FILE__) + '<%= '/..' * class_nesting_depth %>/../../spec_helper')
|
2
2
|
|
3
|
-
<% output_attributes = attributes.reject{|attribute|
|
3
|
+
<% output_attributes = attributes.reject{|attribute| [:datetime, :timestamp, :time, :date].index(attribute.type) } -%>
|
4
4
|
describe "/<%= table_name %>/index.<%= default_file_extension %>" do
|
5
5
|
include <%= controller_class_name %>Helper
|
6
6
|
|
@@ -21,7 +21,7 @@ describe "/<%= table_name %>/index.<%= default_file_extension %>" do
|
|
21
21
|
it "should render list of <%= table_name %>" do
|
22
22
|
render "/<%= table_name %>/index.<%= default_file_extension %>"
|
23
23
|
<% for attribute in output_attributes -%>
|
24
|
-
response.should have_tag("tr>td", <%= attribute.default_value
|
24
|
+
response.should have_tag("tr>td", <%= attribute.default_value %>.to_s, 2)
|
25
25
|
<% end -%>
|
26
26
|
end
|
27
27
|
end
|
@@ -1,6 +1,6 @@
|
|
1
1
|
require File.expand_path(File.dirname(__FILE__) + '<%= '/..' * class_nesting_depth %>/../../spec_helper')
|
2
2
|
|
3
|
-
<% output_attributes = attributes.reject{|attribute|
|
3
|
+
<% output_attributes = attributes.reject{|attribute| [:datetime, :timestamp, :time, :date].index(attribute.type) } -%>
|
4
4
|
describe "/<%= table_name %>/new.<%= default_file_extension %>" do
|
5
5
|
include <%= controller_class_name %>Helper
|
6
6
|
|
@@ -1,6 +1,6 @@
|
|
1
1
|
require File.expand_path(File.dirname(__FILE__) + '<%= '/..' * class_nesting_depth %>/../../spec_helper')
|
2
2
|
|
3
|
-
<% output_attributes = attributes.reject{|attribute|
|
3
|
+
<% output_attributes = attributes.reject{|attribute| [:datetime, :timestamp, :time, :date].index(attribute.type) } -%>
|
4
4
|
describe "/<%= table_name %>/show.<%= default_file_extension %>" do
|
5
5
|
include <%= controller_class_name %>Helper
|
6
6
|
before(:each) do
|
@@ -16,7 +16,7 @@ describe "/<%= table_name %>/show.<%= default_file_extension %>" do
|
|
16
16
|
it "should render attributes in <p>" do
|
17
17
|
render "/<%= table_name %>/show.<%= default_file_extension %>"
|
18
18
|
<% for attribute in output_attributes -%>
|
19
|
-
response.should have_text(/<%= Regexp.escape(attribute.default_value)
|
19
|
+
response.should have_text(/<%= Regexp.escape(attribute.default_value).gsub(/^"|"$/, '')%>/)
|
20
20
|
<% end -%>
|
21
21
|
end
|
22
22
|
end
|
@@ -202,6 +202,16 @@ module Spec
|
|
202
202
|
@_first_render ||= args[0] unless args[0] =~ /^layouts/
|
203
203
|
PickedTemplate.new
|
204
204
|
end
|
205
|
+
|
206
|
+
define_method :render do |*args|
|
207
|
+
if @_rendered
|
208
|
+
opts = args[0]
|
209
|
+
(@_rendered[:template] ||= opts[:file]) if opts[:file]
|
210
|
+
(@_rendered[:partials][opts[:partial]] += 1) if opts[:partial]
|
211
|
+
else
|
212
|
+
super
|
213
|
+
end
|
214
|
+
end
|
205
215
|
end
|
206
216
|
end
|
207
217
|
end
|
@@ -8,26 +8,21 @@ module Spec
|
|
8
8
|
module Rails
|
9
9
|
|
10
10
|
module Example
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
# However, Rails >= r8664 extracted these out to use ActiveSupport::Callbacks.
|
15
|
-
# The latter case is handled at the TestCase level, in interop/testcase.rb
|
16
|
-
unless ActiveSupport.const_defined?(:Callbacks) and self.include?(ActiveSupport::Callbacks)
|
17
|
-
before(:each) do
|
18
|
-
setup_fixtures if self.respond_to?(:setup_fixtures)
|
19
|
-
end
|
20
|
-
after(:each) do
|
21
|
-
teardown_fixtures if self.respond_to?(:teardown_fixtures)
|
22
|
-
end
|
11
|
+
if ActiveSupport.const_defined?(:TestCase)
|
12
|
+
class RailsExampleGroup < ActiveSupport::TestCase
|
13
|
+
include ActionController::Assertions::SelectorAssertions
|
23
14
|
end
|
24
|
-
|
15
|
+
else
|
16
|
+
class RailsExampleGroup < Test::Unit::TestCase
|
17
|
+
end
|
18
|
+
end
|
19
|
+
|
20
|
+
class RailsExampleGroup
|
25
21
|
include Spec::Rails::Matchers
|
26
22
|
include Spec::Rails::Mocks
|
27
|
-
|
28
23
|
Spec::Example::ExampleGroupFactory.default(self)
|
29
|
-
|
30
24
|
end
|
25
|
+
|
31
26
|
end
|
32
27
|
end
|
33
28
|
end
|
@@ -1,8 +1,13 @@
|
|
1
1
|
require 'spec/example/configuration'
|
2
|
+
require 'test_help'
|
3
|
+
|
2
4
|
begin
|
3
5
|
module Spec
|
4
6
|
module Example
|
5
7
|
class Configuration
|
8
|
+
|
9
|
+
TEST_CASE = ActiveSupport.const_defined?(:TestCase) ? ActiveSupport::TestCase : Test::Unit::TestCase
|
10
|
+
|
6
11
|
# Rails 1.2.3 does a copy of the @inheritable_attributes to the subclass when the subclass is
|
7
12
|
# created. This causes an ordering issue when setting state on Configuration because the data is
|
8
13
|
# already copied.
|
@@ -10,7 +15,7 @@ module Spec
|
|
10
15
|
# @inheritable_attributes updated.
|
11
16
|
# TODO: BT - When we no longer support Rails 1.2.3, we can remove this functionality
|
12
17
|
EXAMPLE_GROUP_CLASSES = [
|
13
|
-
|
18
|
+
TEST_CASE,
|
14
19
|
::Spec::Rails::Example::RailsExampleGroup,
|
15
20
|
::Spec::Rails::Example::FunctionalExampleGroup,
|
16
21
|
::Spec::Rails::Example::ControllerExampleGroup,
|
@@ -26,7 +31,7 @@ module Spec
|
|
26
31
|
end
|
27
32
|
|
28
33
|
def use_transactional_fixtures
|
29
|
-
|
34
|
+
TEST_CASE.use_transactional_fixtures
|
30
35
|
end
|
31
36
|
def use_transactional_fixtures=(value)
|
32
37
|
EXAMPLE_GROUP_CLASSES.each do |example_group|
|
@@ -35,7 +40,7 @@ module Spec
|
|
35
40
|
end
|
36
41
|
|
37
42
|
def use_instantiated_fixtures
|
38
|
-
|
43
|
+
TEST_CASE.use_instantiated_fixtures
|
39
44
|
end
|
40
45
|
def use_instantiated_fixtures=(value)
|
41
46
|
EXAMPLE_GROUP_CLASSES.each do |example_group|
|
@@ -44,7 +49,7 @@ module Spec
|
|
44
49
|
end
|
45
50
|
|
46
51
|
def fixture_path
|
47
|
-
|
52
|
+
TEST_CASE.fixture_path
|
48
53
|
end
|
49
54
|
def fixture_path=(path)
|
50
55
|
EXAMPLE_GROUP_CLASSES.each do |example_group|
|
@@ -53,7 +58,7 @@ module Spec
|
|
53
58
|
end
|
54
59
|
|
55
60
|
def global_fixtures
|
56
|
-
|
61
|
+
TEST_CASE.fixture_table_names
|
57
62
|
end
|
58
63
|
def global_fixtures=(fixtures)
|
59
64
|
EXAMPLE_GROUP_CLASSES.each do |example_group|
|
@@ -10,9 +10,19 @@ module Spec
|
|
10
10
|
end
|
11
11
|
|
12
12
|
def matches?(response)
|
13
|
-
|
14
13
|
if response.respond_to?(:rendered_file)
|
15
14
|
@actual = response.rendered_file
|
15
|
+
elsif response.respond_to?(:rendered)
|
16
|
+
case template = response.rendered[:template]
|
17
|
+
when nil
|
18
|
+
unless response.rendered[:partials].empty?
|
19
|
+
@actual = path_and_file(response.rendered[:partials].keys.first).join("/_")
|
20
|
+
end
|
21
|
+
when ActionView::Template
|
22
|
+
@actual = template.path
|
23
|
+
when String
|
24
|
+
@actual = template
|
25
|
+
end
|
16
26
|
else
|
17
27
|
@actual = response.rendered_template.to_s
|
18
28
|
end
|
data/lib/spec/rails/version.rb
CHANGED
data/lib/spec/rails.rb
CHANGED
@@ -1,6 +1,11 @@
|
|
1
1
|
silence_warnings { RAILS_ENV = "test" }
|
2
2
|
|
3
|
-
|
3
|
+
begin
|
4
|
+
require_dependency 'application_controller'
|
5
|
+
rescue MissingSourceFile
|
6
|
+
require_dependency 'application'
|
7
|
+
end
|
8
|
+
|
4
9
|
require 'action_controller/test_process'
|
5
10
|
require 'action_controller/integration'
|
6
11
|
require 'active_record/fixtures' if defined?(ActiveRecord::Base)
|
data/rspec-rails.gemspec
CHANGED
@@ -2,34 +2,35 @@
|
|
2
2
|
|
3
3
|
Gem::Specification.new do |s|
|
4
4
|
s.name = %q{rspec-rails}
|
5
|
-
s.version = "1.1.11.
|
5
|
+
s.version = "1.1.11.2"
|
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"]
|
9
|
-
s.date = %q{2008-
|
9
|
+
s.date = %q{2008-12-18}
|
10
10
|
s.description = %q{Behaviour Driven Development for Ruby on Rails.}
|
11
11
|
s.email = ["rspec-devel@rubyforge.org"]
|
12
12
|
s.extra_rdoc_files = ["History.txt", "License.txt", "Manifest.txt", "README.txt", "generators/rspec/templates/previous_failures.txt"]
|
13
|
-
s.files = ["History.txt", "License.txt", "Manifest.txt", "README.txt", "Rakefile", "
|
13
|
+
s.files = ["History.txt", "License.txt", "Manifest.txt", "README.txt", "Rakefile", "features/step_definitions/people.rb", "features/support/env.rb", "features/transactions/transactions_should_rollback.feature", "generators/rspec/CHANGES", "generators/rspec/rspec_generator.rb", "generators/rspec/templates/all_stories.rb", "generators/rspec/templates/previous_failures.txt", "generators/rspec/templates/rcov.opts", "generators/rspec/templates/rspec.rake", "generators/rspec/templates/script/autospec", "generators/rspec/templates/script/spec", "generators/rspec/templates/script/spec_server", "generators/rspec/templates/spec.opts", "generators/rspec/templates/spec_helper.rb", "generators/rspec/templates/stories_helper.rb", "generators/rspec_controller/USAGE", "generators/rspec_controller/rspec_controller_generator.rb", "generators/rspec_controller/templates/controller_spec.rb", "generators/rspec_controller/templates/helper_spec.rb", "generators/rspec_controller/templates/view_spec.rb", "generators/rspec_default_values.rb", "generators/rspec_model/USAGE", "generators/rspec_model/rspec_model_generator.rb", "generators/rspec_model/templates/model_spec.rb", "generators/rspec_scaffold/rspec_scaffold_generator.rb", "generators/rspec_scaffold/templates/controller_spec.rb", "generators/rspec_scaffold/templates/edit_erb_spec.rb", "generators/rspec_scaffold/templates/helper_spec.rb", "generators/rspec_scaffold/templates/index_erb_spec.rb", "generators/rspec_scaffold/templates/new_erb_spec.rb", "generators/rspec_scaffold/templates/routing_spec.rb", "generators/rspec_scaffold/templates/show_erb_spec.rb", "init.rb", "lib/autotest/discover.rb", "lib/autotest/rails_rspec.rb", "lib/spec/rails.rb", "lib/spec/rails/example.rb", "lib/spec/rails/example/assigns_hash_proxy.rb", "lib/spec/rails/example/controller_example_group.rb", "lib/spec/rails/example/cookies_proxy.rb", "lib/spec/rails/example/functional_example_group.rb", "lib/spec/rails/example/helper_example_group.rb", "lib/spec/rails/example/model_example_group.rb", "lib/spec/rails/example/rails_example_group.rb", "lib/spec/rails/example/render_observer.rb", "lib/spec/rails/example/view_example_group.rb", "lib/spec/rails/extensions.rb", "lib/spec/rails/extensions/action_controller/base.rb", "lib/spec/rails/extensions/action_controller/rescue.rb", "lib/spec/rails/extensions/action_controller/test_response.rb", "lib/spec/rails/extensions/action_view/base.rb", "lib/spec/rails/extensions/active_record/base.rb", "lib/spec/rails/extensions/object.rb", "lib/spec/rails/extensions/spec/example/configuration.rb", "lib/spec/rails/extensions/spec/matchers/have.rb", "lib/spec/rails/interop/testcase.rb", "lib/spec/rails/matchers.rb", "lib/spec/rails/matchers/assert_select.rb", "lib/spec/rails/matchers/change.rb", "lib/spec/rails/matchers/have_text.rb", "lib/spec/rails/matchers/include_text.rb", "lib/spec/rails/matchers/redirect_to.rb", "lib/spec/rails/matchers/render_template.rb", "lib/spec/rails/mocks.rb", "lib/spec/rails/story_adapter.rb", "lib/spec/rails/version.rb", "rspec-rails.gemspec", "spec/rails/autotest/mappings_spec.rb", "spec/rails/example/assigns_hash_proxy_spec.rb", "spec/rails/example/configuration_spec.rb", "spec/rails/example/controller_isolation_spec.rb", "spec/rails/example/controller_spec_spec.rb", "spec/rails/example/cookies_proxy_spec.rb", "spec/rails/example/example_group_factory_spec.rb", "spec/rails/example/helper_spec_spec.rb", "spec/rails/example/model_spec_spec.rb", "spec/rails/example/shared_behaviour_spec.rb", "spec/rails/example/test_unit_assertion_accessibility_spec.rb", "spec/rails/example/view_spec_spec.rb", "spec/rails/extensions/action_controller_rescue_action_spec.rb", "spec/rails/extensions/action_view_base_spec.rb", "spec/rails/extensions/active_record_spec.rb", "spec/rails/interop/testcase_spec.rb", "spec/rails/matchers/assert_select_spec.rb", "spec/rails/matchers/description_generation_spec.rb", "spec/rails/matchers/errors_on_spec.rb", "spec/rails/matchers/have_text_spec.rb", "spec/rails/matchers/include_text_spec.rb", "spec/rails/matchers/redirect_to_spec.rb", "spec/rails/matchers/render_template_spec.rb", "spec/rails/matchers/should_change_spec.rb", "spec/rails/mocks/ar_classes.rb", "spec/rails/mocks/mock_model_spec.rb", "spec/rails/mocks/stub_model_spec.rb", "spec/rails/sample_modified_fixture.rb", "spec/rails/sample_spec.rb", "spec/rails/spec_server_spec.rb", "spec/rails/spec_spec.rb", "spec/rails_suite.rb", "spec/resources/controllers/action_view_base_spec_controller.rb", "spec/resources/controllers/controller_spec_controller.rb", "spec/resources/controllers/redirect_spec_controller.rb", "spec/resources/controllers/render_spec_controller.rb", "spec/resources/controllers/rjs_spec_controller.rb", "spec/resources/helpers/addition_helper.rb", "spec/resources/helpers/explicit_helper.rb", "spec/resources/helpers/more_explicit_helper.rb", "spec/resources/helpers/plugin_application_helper.rb", "spec/resources/helpers/view_spec_helper.rb", "spec/resources/views/controller_spec/_partial.rhtml", "spec/resources/views/controller_spec/action_setting_flash_after_session_reset.rhtml", "spec/resources/views/controller_spec/action_setting_flash_before_session_reset.rhtml", "spec/resources/views/controller_spec/action_setting_the_assigns_hash.rhtml", "spec/resources/views/controller_spec/action_with_errors_in_template.rhtml", "spec/resources/views/controller_spec/action_with_template.rhtml", "spec/resources/views/layouts/application.rhtml", "spec/resources/views/layouts/simple.rhtml", "spec/resources/views/objects/_object.html.erb", "spec/resources/views/render_spec/_a_partial.rhtml", "spec/resources/views/render_spec/action_with_alternate_layout.rhtml", "spec/resources/views/render_spec/some_action.js.rjs", "spec/resources/views/render_spec/some_action.rhtml", "spec/resources/views/render_spec/some_action.rjs", "spec/resources/views/rjs_spec/_replacement_partial.rhtml", "spec/resources/views/rjs_spec/hide_div.rjs", "spec/resources/views/rjs_spec/hide_page_element.rjs", "spec/resources/views/rjs_spec/insert_html.rjs", "spec/resources/views/rjs_spec/replace.rjs", "spec/resources/views/rjs_spec/replace_html.rjs", "spec/resources/views/rjs_spec/replace_html_with_partial.rjs", "spec/resources/views/rjs_spec/visual_effect.rjs", "spec/resources/views/rjs_spec/visual_toggle_effect.rjs", "spec/resources/views/tag_spec/no_tags.rhtml", "spec/resources/views/tag_spec/single_div_with_no_attributes.rhtml", "spec/resources/views/tag_spec/single_div_with_one_attribute.rhtml", "spec/resources/views/view_spec/_partial.rhtml", "spec/resources/views/view_spec/_partial_used_twice.rhtml", "spec/resources/views/view_spec/_partial_with_local_variable.rhtml", "spec/resources/views/view_spec/_partial_with_sub_partial.rhtml", "spec/resources/views/view_spec/_spacer.rhtml", "spec/resources/views/view_spec/accessor.rhtml", "spec/resources/views/view_spec/block_helper.rhtml", "spec/resources/views/view_spec/entry_form.rhtml", "spec/resources/views/view_spec/explicit_helper.rhtml", "spec/resources/views/view_spec/foo/show.rhtml", "spec/resources/views/view_spec/implicit_helper.rhtml", "spec/resources/views/view_spec/multiple_helpers.rhtml", "spec/resources/views/view_spec/path_params.html.erb", "spec/resources/views/view_spec/should_not_receive.rhtml", "spec/resources/views/view_spec/template_with_partial.rhtml", "spec/resources/views/view_spec/template_with_partial_using_collection.rhtml", "spec/resources/views/view_spec/template_with_partial_with_array.rhtml", "spec/spec_helper.rb"]
|
14
14
|
s.has_rdoc = true
|
15
15
|
s.homepage = %q{http://rspec.info/}
|
16
16
|
s.rdoc_options = ["--main", "README.txt"]
|
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.11.
|
20
|
+
s.summary = %q{rspec-rails 1.1.11.2}
|
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<rspec>, ["= 1.1.11.
|
27
|
+
s.add_runtime_dependency(%q<rspec>, ["= 1.1.11.2"])
|
28
|
+
s.add_runtime_dependency(%q<cucumber>, [">= 0.1.13"])
|
28
29
|
s.add_development_dependency(%q<hoe>, [">= 1.8.2"])
|
29
30
|
else
|
30
|
-
s.add_dependency(%q<rspec>, ["= 1.1.11.
|
31
|
+
s.add_dependency(%q<rspec>, ["= 1.1.11.2"])
|
31
32
|
end
|
32
33
|
else
|
33
|
-
s.add_dependency(%q<rspec>, ["= 1.1.11.
|
34
|
+
s.add_dependency(%q<rspec>, ["= 1.1.11.2"])
|
34
35
|
end
|
35
36
|
end
|
@@ -9,18 +9,18 @@ module Spec
|
|
9
9
|
end
|
10
10
|
|
11
11
|
describe "#use_transactional_fixtures" do
|
12
|
-
it "should return
|
13
|
-
config.use_transactional_fixtures.should ==
|
12
|
+
it "should return #{Spec::Example::Configuration::TEST_CASE}.use_transactional_fixtures" do
|
13
|
+
config.use_transactional_fixtures.should == Spec::Example::Configuration::TEST_CASE.use_transactional_fixtures
|
14
14
|
end
|
15
15
|
|
16
|
-
it "should set
|
16
|
+
it "should set #{Spec::Example::Configuration::TEST_CASE}.use_transactional_fixtures to false" do
|
17
17
|
Configuration::EXAMPLE_GROUP_CLASSES.each do |example_group|
|
18
18
|
example_group.should_receive(:use_transactional_fixtures=).with(false)
|
19
19
|
end
|
20
20
|
config.use_transactional_fixtures = false
|
21
21
|
end
|
22
22
|
|
23
|
-
it "should set
|
23
|
+
it "should set #{Spec::Example::Configuration::TEST_CASE}.use_transactional_fixtures to true" do
|
24
24
|
Configuration::EXAMPLE_GROUP_CLASSES.each do |example_group|
|
25
25
|
example_group.should_receive(:use_transactional_fixtures=).with(true)
|
26
26
|
end
|
@@ -29,18 +29,18 @@ module Spec
|
|
29
29
|
end
|
30
30
|
|
31
31
|
describe "#use_instantiated_fixtures" do
|
32
|
-
it "should return
|
33
|
-
config.use_instantiated_fixtures.should ==
|
32
|
+
it "should return #{Spec::Example::Configuration::TEST_CASE}.use_transactional_fixtures" do
|
33
|
+
config.use_instantiated_fixtures.should == Spec::Example::Configuration::TEST_CASE.use_instantiated_fixtures
|
34
34
|
end
|
35
35
|
|
36
|
-
it "should set
|
36
|
+
it "should set #{Spec::Example::Configuration::TEST_CASE}.use_instantiated_fixtures to false" do
|
37
37
|
Configuration::EXAMPLE_GROUP_CLASSES.each do |example_group|
|
38
38
|
example_group.should_receive(:use_instantiated_fixtures=).with(false)
|
39
39
|
end
|
40
40
|
config.use_instantiated_fixtures = false
|
41
41
|
end
|
42
42
|
|
43
|
-
it "should set
|
43
|
+
it "should set #{Spec::Example::Configuration::TEST_CASE}.use_instantiated_fixtures to true" do
|
44
44
|
Configuration::EXAMPLE_GROUP_CLASSES.each do |example_group|
|
45
45
|
example_group.should_receive(:use_instantiated_fixtures=).with(true)
|
46
46
|
end
|
@@ -17,6 +17,10 @@ if ActiveSupport.const_defined?(:Callbacks) && Test::Unit::TestCase.include?(Act
|
|
17
17
|
def self.run?
|
18
18
|
@@has_been_run
|
19
19
|
end
|
20
|
+
|
21
|
+
def self.run(options=Spec::Runner.options)
|
22
|
+
super options
|
23
|
+
end
|
20
24
|
|
21
25
|
def do_some_setup
|
22
26
|
@@setup_callback_count += 1
|
@@ -63,4 +67,4 @@ if ActiveSupport.const_defined?(:Callbacks) && Test::Unit::TestCase.include?(Act
|
|
63
67
|
end
|
64
68
|
end
|
65
69
|
|
66
|
-
end
|
70
|
+
end
|
@@ -0,0 +1 @@
|
|
1
|
+
<%= params[:controller] %>
|
data/spec/spec_helper.rb
CHANGED
@@ -50,6 +50,7 @@ Spec::Runner.configure do |config|
|
|
50
50
|
end
|
51
51
|
|
52
52
|
|
53
|
+
ActionController::Routing::Routes.clear! # only since we're drawing routes here
|
53
54
|
ActionController::Routing::Routes.draw do |map|
|
54
55
|
map.resources :rspec_on_rails_specs
|
55
56
|
map.connect 'custom_route', :controller => 'custom_route_spec', :action => 'custom_route'
|
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.11.
|
4
|
+
version: 1.1.11.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- RSpec Development Team
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2008-
|
12
|
+
date: 2008-12-18 00:00:00 -08:00
|
13
13
|
default_executable:
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
@@ -19,7 +19,7 @@ dependencies:
|
|
19
19
|
requirements:
|
20
20
|
- - "="
|
21
21
|
- !ruby/object:Gem::Version
|
22
|
-
version: 1.1.11.
|
22
|
+
version: 1.1.11.2
|
23
23
|
version:
|
24
24
|
description: Behaviour Driven Development for Ruby on Rails.
|
25
25
|
email:
|
@@ -40,7 +40,9 @@ files:
|
|
40
40
|
- Manifest.txt
|
41
41
|
- README.txt
|
42
42
|
- Rakefile
|
43
|
-
-
|
43
|
+
- features/step_definitions/people.rb
|
44
|
+
- features/support/env.rb
|
45
|
+
- features/transactions/transactions_should_rollback.feature
|
44
46
|
- generators/rspec/CHANGES
|
45
47
|
- generators/rspec/rspec_generator.rb
|
46
48
|
- generators/rspec/templates/all_stories.rb
|
@@ -185,17 +187,12 @@ files:
|
|
185
187
|
- spec/resources/views/view_spec/foo/show.rhtml
|
186
188
|
- spec/resources/views/view_spec/implicit_helper.rhtml
|
187
189
|
- spec/resources/views/view_spec/multiple_helpers.rhtml
|
190
|
+
- spec/resources/views/view_spec/path_params.html.erb
|
188
191
|
- spec/resources/views/view_spec/should_not_receive.rhtml
|
189
192
|
- spec/resources/views/view_spec/template_with_partial.rhtml
|
190
193
|
- spec/resources/views/view_spec/template_with_partial_using_collection.rhtml
|
191
194
|
- spec/resources/views/view_spec/template_with_partial_with_array.rhtml
|
192
195
|
- spec/spec_helper.rb
|
193
|
-
- stories/all.rb
|
194
|
-
- stories/configuration/stories.rb
|
195
|
-
- stories/helper.rb
|
196
|
-
- stories/steps/people.rb
|
197
|
-
- stories/transactions_should_rollback
|
198
|
-
- stories/transactions_should_rollback.rb
|
199
196
|
has_rdoc: true
|
200
197
|
homepage: http://rspec.info/
|
201
198
|
post_install_message:
|
@@ -222,6 +219,6 @@ rubyforge_project: rspec
|
|
222
219
|
rubygems_version: 1.2.0
|
223
220
|
signing_key:
|
224
221
|
specification_version: 2
|
225
|
-
summary: rspec-rails 1.1.11.
|
222
|
+
summary: rspec-rails 1.1.11.2
|
226
223
|
test_files: []
|
227
224
|
|
data/UPGRADE
DELETED
data/stories/all.rb
DELETED
@@ -1,10 +0,0 @@
|
|
1
|
-
require File.join(File.dirname(__FILE__), *%w[helper])
|
2
|
-
require File.join(File.dirname(__FILE__), *%w[steps people])
|
3
|
-
|
4
|
-
# Run transactions_should_rollback in Ruby
|
5
|
-
require File.join(File.dirname(__FILE__), *%w[transactions_should_rollback])
|
6
|
-
|
7
|
-
# Run transactions_should_rollback in Plain Text
|
8
|
-
with_steps_for :people do
|
9
|
-
run File.join(File.dirname(__FILE__), *%w[transactions_should_rollback]), :type => RailsStory
|
10
|
-
end
|
data/stories/helper.rb
DELETED
data/stories/steps/people.rb
DELETED
@@ -1,25 +0,0 @@
|
|
1
|
-
require File.join(File.dirname(__FILE__), *%w[helper])
|
2
|
-
|
3
|
-
Story "transactions should rollback", %{
|
4
|
-
As an RSpec/Rails Story author
|
5
|
-
I want transactions to roll back between scenarios
|
6
|
-
So that I can have confidence in the state of the database
|
7
|
-
}, :type => RailsStory do
|
8
|
-
Scenario "add one Person" do
|
9
|
-
When "I add a Person" do
|
10
|
-
Person.create!(:name => "Foo")
|
11
|
-
end
|
12
|
-
end
|
13
|
-
|
14
|
-
Scenario "add another person" do
|
15
|
-
GivenScenario "add one Person"
|
16
|
-
Then "there should be one person" do
|
17
|
-
Person.count.should == 1
|
18
|
-
end
|
19
|
-
end
|
20
|
-
|
21
|
-
Scenario "add yet another person" do
|
22
|
-
GivenScenario "add one Person"
|
23
|
-
Then "there should be one person"
|
24
|
-
end
|
25
|
-
end
|
File without changes
|