rspec-rails 1.3.0 → 1.3.1
Sign up to get free protection for your applications and to get access to all the features.
- data/History.rdoc +6 -0
- data/lib/spec/rails/matchers.rb +9 -10
- data/lib/spec/rails/matchers/ar_be_valid.rb +19 -15
- data/lib/spec/rails/version.rb +1 -1
- metadata +4 -4
data/History.rdoc
CHANGED
data/lib/spec/rails/matchers.rb
CHANGED
@@ -1,13 +1,3 @@
|
|
1
|
-
dir = File.dirname(__FILE__)
|
2
|
-
require 'spec/rails/matchers/ar_be_valid'
|
3
|
-
require 'spec/rails/matchers/assert_select'
|
4
|
-
require 'spec/rails/matchers/change'
|
5
|
-
require 'spec/rails/matchers/have_text'
|
6
|
-
require 'spec/rails/matchers/include_text'
|
7
|
-
require 'spec/rails/matchers/redirect_to'
|
8
|
-
require 'spec/rails/matchers/route_to'
|
9
|
-
require 'spec/rails/matchers/render_template'
|
10
|
-
|
11
1
|
module Spec
|
12
2
|
module Rails
|
13
3
|
# Spec::Rails::Expectations::Matchers provides several expectation matchers
|
@@ -31,3 +21,12 @@ module Spec
|
|
31
21
|
end
|
32
22
|
end
|
33
23
|
end
|
24
|
+
|
25
|
+
require 'spec/rails/matchers/ar_be_valid'
|
26
|
+
require 'spec/rails/matchers/assert_select'
|
27
|
+
require 'spec/rails/matchers/change'
|
28
|
+
require 'spec/rails/matchers/have_text'
|
29
|
+
require 'spec/rails/matchers/include_text'
|
30
|
+
require 'spec/rails/matchers/redirect_to'
|
31
|
+
require 'spec/rails/matchers/route_to'
|
32
|
+
require 'spec/rails/matchers/render_template'
|
@@ -1,23 +1,27 @@
|
|
1
1
|
if defined?(ActiveRecord::Base)
|
2
|
-
module Spec
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
2
|
+
module Spec
|
3
|
+
module Rails
|
4
|
+
module Matchers
|
5
|
+
# :call-seq:
|
6
|
+
# response.should be_valid
|
7
|
+
# response.should_not be_valid
|
8
|
+
def be_valid
|
9
|
+
::Spec::Matchers::Matcher.new :be_valid do
|
10
|
+
match do |actual|
|
11
|
+
actual.valid?
|
12
|
+
end
|
11
13
|
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
14
|
+
failure_message_for_should do |actual|
|
15
|
+
if actual.respond_to?(:errors) && ActiveRecord::Errors === actual.errors
|
16
|
+
"Expected #{actual.inspect} to be valid, but it was not\nErrors: " + actual.errors.full_messages.join(", ")
|
17
|
+
else
|
18
|
+
"Expected #{actual.inspect} to be valid"
|
19
|
+
end
|
20
|
+
end
|
17
21
|
end
|
18
22
|
end
|
23
|
+
|
19
24
|
end
|
20
25
|
end
|
21
|
-
|
22
26
|
end
|
23
27
|
end
|
data/lib/spec/rails/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rspec-rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.3.
|
4
|
+
version: 1.3.1
|
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: 2010-01-
|
12
|
+
date: 2010-01-12 00:00:00 -06:00
|
13
13
|
default_executable:
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
@@ -237,7 +237,7 @@ licenses: []
|
|
237
237
|
post_install_message: |
|
238
238
|
**************************************************
|
239
239
|
|
240
|
-
Thank you for installing rspec-rails-1.3.
|
240
|
+
Thank you for installing rspec-rails-1.3.1
|
241
241
|
|
242
242
|
If you are upgrading, do this in each of your rails apps
|
243
243
|
that you want to upgrade:
|
@@ -272,6 +272,6 @@ rubyforge_project: rspec
|
|
272
272
|
rubygems_version: 1.3.5
|
273
273
|
signing_key:
|
274
274
|
specification_version: 3
|
275
|
-
summary: rspec-rails 1.3.
|
275
|
+
summary: rspec-rails 1.3.1
|
276
276
|
test_files: []
|
277
277
|
|