brightbox-rspec-rails-ext 1.6.3 → 1.7

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/CHANGELOG CHANGED
@@ -1,4 +1,5 @@
1
- v1.6.3 Changed the output when status/locations don't match
1
+ v1.7. Added use_layout matcher
2
+ v1.6.3. Changed the output when status/locations don't match
2
3
  v1.6.2. Changed how we match the status header
3
4
  v1.6.1. Added associated_model builder
4
5
  v1.6.0. Pushed a version that actually works (oops, sorry about that)
data/Manifest CHANGED
@@ -3,6 +3,7 @@ lib/controller_example_group.rb
3
3
  lib/mocks.rb
4
4
  lib/responses.rb
5
5
  lib/rspec_rails_extensions.rb
6
+ lib/use_layout.rb
6
7
  LICENCE
7
8
  Manifest
8
9
  Rakefile
data/README.rdoc CHANGED
@@ -44,6 +44,11 @@ Some helpful matchers for testing HTTP statuses beyond the default be_success (2
44
44
 
45
45
  # looks for a 500
46
46
  response.should be_an_error
47
+
48
+ Also a helper for testing which layout was used
49
+
50
+ # Makes sure it used the "bare" layout
51
+ response.should use_layout("bare")
47
52
 
48
53
  == Specifying your controllers
49
54
 
@@ -1,4 +1,5 @@
1
1
  require 'spec/rails'
2
2
  require 'mocks'
3
3
  require 'responses'
4
- require 'controller_example_group'
4
+ require 'controller_example_group'
5
+ require "use_layout"
data/lib/use_layout.rb ADDED
@@ -0,0 +1,29 @@
1
+ =begin rdoc
2
+ Module for testing the layout used in a response object
3
+ =end
4
+ module ResponseMatchers
5
+ # From http://rubyforge.org/pipermail/rspec-users/2007-May/001818.html
6
+ class UseLayout
7
+ def initialize(expected)
8
+ @expected = 'layouts/' + expected
9
+ end
10
+
11
+ def matches?(controller)
12
+ @actual = controller.layout
13
+ #@actual.equal?(@expected)
14
+ @actual == @expected
15
+ end
16
+
17
+ def failure_message
18
+ return "use_layout expected #{@expected.inspect}, got #{@actual.inspect}", @expected, @actual
19
+ end
20
+
21
+ def negeative_failure_message
22
+ return "use_layout expected #{@expected.inspect} not to equal #{@actual.inspect}", @expected, @actual
23
+ end
24
+ end
25
+
26
+ def use_layout(expected)
27
+ UseLayout.new(expected)
28
+ end
29
+ end
@@ -2,21 +2,20 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = %q{rspec-rails-ext}
5
- s.version = "1.6.3"
5
+ s.version = "1.7"
6
6
 
7
7
  s.required_rubygems_version = Gem::Requirement.new(">= 1.2") if s.respond_to? :required_rubygems_version=
8
8
  s.authors = ["Rahoul Baruah, Caius Durling"]
9
- s.date = %q{2009-04-22}
9
+ s.date = %q{2009-07-03}
10
10
  s.description = %q{Helpers for prettying up your RSpec-Rails specifications}
11
11
  s.email = %q{support@brightbox.co.uk}
12
- s.extra_rdoc_files = ["CHANGELOG", "lib/controller_example_group.rb", "lib/mocks.rb", "lib/responses.rb", "lib/rspec_rails_extensions.rb", "README.rdoc"]
13
- s.files = ["CHANGELOG", "lib/controller_example_group.rb", "lib/mocks.rb", "lib/responses.rb", "lib/rspec_rails_extensions.rb", "LICENCE", "Manifest", "Rakefile", "README.rdoc", "rspec-rails-ext.gemspec"]
14
- s.has_rdoc = true
12
+ s.extra_rdoc_files = ["CHANGELOG", "lib/controller_example_group.rb", "lib/mocks.rb", "lib/responses.rb", "lib/rspec_rails_extensions.rb", "lib/use_layout.rb", "README.rdoc"]
13
+ s.files = ["CHANGELOG", "lib/controller_example_group.rb", "lib/mocks.rb", "lib/responses.rb", "lib/rspec_rails_extensions.rb", "lib/use_layout.rb", "LICENCE", "Manifest", "Rakefile", "README.rdoc", "rspec-rails-ext.gemspec"]
15
14
  s.homepage = %q{http://github.com/brightbox/rspec-rails-extensions/tree/master}
16
15
  s.rdoc_options = ["--line-numbers", "--inline-source", "--title", "Rspec-rails-ext", "--main", "README.rdoc"]
17
16
  s.require_paths = ["lib"]
18
17
  s.rubyforge_project = %q{rspec-rails-ext}
19
- s.rubygems_version = %q{1.3.2}
18
+ s.rubygems_version = %q{1.3.4}
20
19
  s.summary = %q{Helpers for prettying up your RSpec-Rails specifications}
21
20
 
22
21
  if s.respond_to? :specification_version then
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: brightbox-rspec-rails-ext
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.6.3
4
+ version: "1.7"
5
5
  platform: ruby
6
6
  authors:
7
7
  - Rahoul Baruah, Caius Durling
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-04-22 00:00:00 -07:00
12
+ date: 2009-07-03 00:00:00 -07:00
13
13
  default_executable:
14
14
  dependencies: []
15
15
 
@@ -25,6 +25,7 @@ extra_rdoc_files:
25
25
  - lib/mocks.rb
26
26
  - lib/responses.rb
27
27
  - lib/rspec_rails_extensions.rb
28
+ - lib/use_layout.rb
28
29
  - README.rdoc
29
30
  files:
30
31
  - CHANGELOG
@@ -32,12 +33,13 @@ files:
32
33
  - lib/mocks.rb
33
34
  - lib/responses.rb
34
35
  - lib/rspec_rails_extensions.rb
36
+ - lib/use_layout.rb
35
37
  - LICENCE
36
38
  - Manifest
37
39
  - Rakefile
38
40
  - README.rdoc
39
41
  - rspec-rails-ext.gemspec
40
- has_rdoc: true
42
+ has_rdoc: false
41
43
  homepage: http://github.com/brightbox/rspec-rails-extensions/tree/master
42
44
  post_install_message:
43
45
  rdoc_options: