rspec-rails 1.1.8 → 1.1.9

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,3 +1,12 @@
1
+ === Version 1.1.9 / 2008-10-20
2
+
3
+ * 4 bug fixes
4
+
5
+ * require 'rubygems' in script/spec
6
+ * fix failure message for error_on and errors_on (Patch from Mike Vincent). Fixes #566.
7
+ * fix issues that arise in view spec if passing actual template name to render (Patch from Mike Vincent). Fixes #551.
8
+ * fixed bug accessing assigns from helper examples
9
+
1
10
  === Version 1.1.8 / 2008-10-03
2
11
 
3
12
  * 2 bug fixes
@@ -15,7 +24,7 @@
15
24
 
16
25
  * 1 bug fix
17
26
 
18
- * fixed regression where values assigned to the assigns hash were not accessible from the example (#549)
27
+ * fixed regression where values assigned to the assigns hash were not accessible from the example (#549)
19
28
 
20
29
  === Version 1.1.5 / 2008-09-28
21
30
 
@@ -0,0 +1,33 @@
1
+ (The MIT License)
2
+
3
+ ====================================================================
4
+ ==== RSpec, RSpec-Rails
5
+ Copyright (c) 2005-2008 The RSpec Development Team
6
+ ====================================================================
7
+ ==== ARTS
8
+ Copyright (c) 2006 Kevin Clark, Jake Howerton
9
+ ====================================================================
10
+ ==== ZenTest
11
+ Copyright (c) 2001-2006 Ryan Davis, Eric Hodel, Zen Spider Software
12
+ ====================================================================
13
+ ==== AssertSelect
14
+ Copyright (c) 2006 Assaf Arkin
15
+ ====================================================================
16
+
17
+ Permission is hereby granted, free of charge, to any person obtaining a copy of
18
+ this software and associated documentation files (the "Software"), to deal in
19
+ the Software without restriction, including without limitation the rights to
20
+ use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
21
+ of the Software, and to permit persons to whom the Software is furnished to do
22
+ so, subject to the following conditions:
23
+
24
+ The above copyright notice and this permission notice shall be included in all
25
+ copies or substantial portions of the Software.
26
+
27
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
28
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
29
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
30
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
31
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
32
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
33
+ SOFTWARE.
@@ -1,4 +1,5 @@
1
1
  History.txt
2
+ License.txt
2
3
  Manifest.txt
3
4
  README.txt
4
5
  Rakefile
data/README.txt CHANGED
@@ -2,6 +2,7 @@
2
2
 
3
3
  * http://rspec.info
4
4
  * http://rspec.info/rdoc-rails/
5
+ * http://rubyforge.org/projects/rspec
5
6
  * http://github.com/dchelimsky/rspec-rails/wikis
6
7
  * mailto:rspec-devel@rubyforge.org
7
8
 
@@ -43,39 +44,3 @@ expectations you can set on responses and models, etc.
43
44
  == INSTALL
44
45
 
45
46
  * Visit http://github.com/dchelimsky/rspec-rails/wikis for installation instructions.
46
-
47
- == LICENSE
48
-
49
- (The MIT License)
50
-
51
- ====================================================================
52
- ==== RSpec, RSpec-Rails
53
- Copyright (c) 2005-2008 The RSpec Development Team
54
- ====================================================================
55
- ==== ARTS
56
- Copyright (c) 2006 Kevin Clark, Jake Howerton
57
- ====================================================================
58
- ==== ZenTest
59
- Copyright (c) 2001-2006 Ryan Davis, Eric Hodel, Zen Spider Software
60
- ====================================================================
61
- ==== AssertSelect
62
- Copyright (c) 2006 Assaf Arkin
63
- ====================================================================
64
-
65
- Permission is hereby granted, free of charge, to any person obtaining a copy of
66
- this software and associated documentation files (the "Software"), to deal in
67
- the Software without restriction, including without limitation the rights to
68
- use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
69
- of the Software, and to permit persons to whom the Software is furnished to do
70
- so, subject to the following conditions:
71
-
72
- The above copyright notice and this permission notice shall be included in all
73
- copies or substantial portions of the Software.
74
-
75
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
76
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
77
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
78
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
79
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
80
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
81
- SOFTWARE.
data/Rakefile CHANGED
@@ -15,10 +15,11 @@ 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.8"]]
18
+ p.extra_deps = [["rspec","1.1.9"]]
19
+ p.remote_rdoc_dir = "rspec-rails/#{Spec::Rails::VERSION::STRING}"
19
20
  end
20
21
 
21
- ['audit','test','test_deps','default','publish_docs','post_blog', 'release'].each do |task|
22
+ ['audit','test','test_deps','default','post_blog', 'release'].each do |task|
22
23
  Rake.application.instance_variable_get('@tasks').delete(task)
23
24
  end
24
25
 
@@ -1,3 +1,5 @@
1
1
  #!/usr/bin/env ruby
2
- ENV['RSPEC'] = 'true'
3
- system 'autotest'
2
+ ENV['RSPEC'] = 'true' # allows autotest to discover rspec
3
+ ENV['AUTOTEST'] = 'true' # allows autotest to run w/ color on linux
4
+ system((RUBY_PLATFORM =~ /mswin|mingw/ ? 'autotest.bat' : 'autotest'), *ARGV) ||
5
+ $stderr.puts("Unable to find autotest. Please install ZenTest or fix your PATH")
@@ -1,4 +1,5 @@
1
1
  #!/usr/bin/env ruby
2
2
  $LOAD_PATH.unshift(File.expand_path(File.dirname(__FILE__) + "/../vendor/plugins/rspec/lib"))
3
+ require 'rubygems'
3
4
  require 'spec'
4
5
  exit ::Spec::Runner::CommandLine.run(::Spec::Runner::OptionParser.parse(ARGV, STDERR, STDOUT))
@@ -125,7 +125,7 @@ module Spec
125
125
 
126
126
  attr_reader :response, :request, :controller
127
127
 
128
- def initialize(defined_description, &implementation) #:nodoc:
128
+ def initialize(defined_description, options={}, &implementation) #:nodoc:
129
129
  super
130
130
  controller_class_name = self.class.controller_class_name
131
131
  if controller_class_name
@@ -96,7 +96,11 @@ module Spec
96
96
  def helper
97
97
  self.class.helper
98
98
  end
99
-
99
+
100
+ def orig_assigns
101
+ helper.assigns
102
+ end
103
+
100
104
  # Reverse the load order so that custom helpers which are defined last
101
105
  # are also loaded last.
102
106
  ActionView::Base.included_modules.reverse.each do |mod|
@@ -32,7 +32,7 @@ module Spec
32
32
  ensure_that_base_view_path_is_not_set_across_example_groups
33
33
  end
34
34
 
35
- def initialize(defined_description, &implementation) #:nodoc:
35
+ def initialize(defined_description, options={}, &implementation) #:nodoc:
36
36
  super
37
37
  @controller_class_name = "Spec::Rails::Example::ViewExampleGroupController"
38
38
  end
@@ -63,7 +63,7 @@ module Spec
63
63
 
64
64
  def derived_action_name(options) #:nodoc:
65
65
  parts = subject_of_render(options).split('/').reject { |part| part.empty? }
66
- "#{parts.last}"
66
+ "#{parts.last}".split('.').first
67
67
  end
68
68
 
69
69
  def subject_of_render(options) #:nodoc:
@@ -5,8 +5,8 @@ module Spec #:nodoc:
5
5
  class Have #:nodoc:
6
6
  alias_method :__original_failure_message, :failure_message
7
7
  def failure_message
8
- return "expected #{relativities[@relativity]}#{@expected} errors on :#{@args[0]}, got #{@actual}" if @collection_name == :errors_on
9
- return "expected #{relativities[@relativity]}#{@expected} error on :#{@args[0]}, got #{@actual}" if @collection_name == :error_on
8
+ return "expected #{relativities[@relativity]}#{@expected} errors on :#{@args[0]}, got #{@given}" if @collection_name == :errors_on
9
+ return "expected #{relativities[@relativity]}#{@expected} error on :#{@args[0]}, got #{@given}" if @collection_name == :error_on
10
10
  return __original_failure_message
11
11
  end
12
12
 
@@ -4,7 +4,7 @@ module Spec
4
4
  unless defined? MAJOR
5
5
  MAJOR = 1
6
6
  MINOR = 1
7
- TINY = 8
7
+ TINY = 9
8
8
 
9
9
  STRING = [MAJOR, MINOR, TINY].join('.')
10
10
 
@@ -130,6 +130,19 @@ module Spec
130
130
  helper.protect_against_forgery?.should be_false
131
131
  end
132
132
  end
133
+
134
+ describe HelperExampleGroup, "#assigns", :type => :helper do
135
+ helper_name :addition
136
+ it "should expose variables to helper" do
137
+ assigns[:addend] = 3
138
+ helper.plus(4).should == 7
139
+ end
140
+
141
+ it "should make helper ivars available in example" do
142
+ assigns[:addend] = 3
143
+ assigns[:addend].should == 3
144
+ end
145
+ end
133
146
  end
134
147
  end
135
148
  end
@@ -242,6 +242,13 @@ describe "render :inline => ...", :type => :view do
242
242
  end
243
243
  end
244
244
 
245
+ describe "render 'view_spec/foo/show.rhtml'", :type => :view do
246
+ it "should derive action name using the first part of the template name" do
247
+ render 'view_spec/foo/show.rhtml'
248
+ request.path_parameters[:action].should == 'show'
249
+ end
250
+ end
251
+
245
252
  module Spec
246
253
  module Rails
247
254
  module Example
@@ -1,13 +1,25 @@
1
1
  require File.dirname(__FILE__) + '/../../spec_helper'
2
2
 
3
3
  describe "error_on" do
4
- it "should provide a message including the name of what the error is on" do
4
+ it "should provide a description including the name of what the error is on" do
5
5
  have(1).error_on(:whatever).description.should == "should have 1 error on :whatever"
6
6
  end
7
+
8
+ it "should provide a failure message including the number actually given" do
9
+ lambda {
10
+ [].should have(1).error_on(:whatever)
11
+ }.should fail_with("expected 1 error on :whatever, got 0")
12
+ end
7
13
  end
8
14
 
9
15
  describe "errors_on" do
10
- it "should provide a message including the name of what the error is on" do
16
+ it "should provide a description including the name of what the error is on" do
11
17
  have(2).errors_on(:whatever).description.should == "should have 2 errors on :whatever"
12
18
  end
13
- end
19
+
20
+ it "should provide a failure message including the number actually given" do
21
+ lambda {
22
+ [1].should have(3).errors_on(:whatever)
23
+ }.should fail_with("expected 3 errors on :whatever, got 1")
24
+ end
25
+ end
@@ -7,6 +7,7 @@ require File.expand_path("#{dir}/../spec_resources/controllers/render_spec_contr
7
7
  require File.expand_path("#{dir}/../spec_resources/controllers/rjs_spec_controller")
8
8
  require File.expand_path("#{dir}/../spec_resources/controllers/redirect_spec_controller")
9
9
  require File.expand_path("#{dir}/../spec_resources/controllers/action_view_base_spec_controller")
10
+ require File.expand_path("#{dir}/../spec_resources/helpers/addition_helper")
10
11
  require File.expand_path("#{dir}/../spec_resources/helpers/explicit_helper")
11
12
  require File.expand_path("#{dir}/../spec_resources/helpers/more_explicit_helper")
12
13
  require File.expand_path("#{dir}/../spec_resources/helpers/view_spec_helper")
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.1.8
4
+ version: 1.1.9
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-10-03 00:00:00 -05:00
12
+ date: 2008-10-20 00:00:00 -05:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
@@ -20,7 +20,7 @@ dependencies:
20
20
  requirements:
21
21
  - - "="
22
22
  - !ruby/object:Gem::Version
23
- version: 1.1.8
23
+ version: 1.1.9
24
24
  version:
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: hoe
@@ -30,7 +30,7 @@ dependencies:
30
30
  requirements:
31
31
  - - ">="
32
32
  - !ruby/object:Gem::Version
33
- version: 1.7.0
33
+ version: 1.8.0
34
34
  version:
35
35
  description: Behaviour Driven Development for Ruby on Rails.
36
36
  email:
@@ -41,11 +41,13 @@ extensions: []
41
41
 
42
42
  extra_rdoc_files:
43
43
  - History.txt
44
+ - License.txt
44
45
  - Manifest.txt
45
46
  - README.txt
46
47
  - generators/rspec/templates/previous_failures.txt
47
48
  files:
48
49
  - History.txt
50
+ - License.txt
49
51
  - Manifest.txt
50
52
  - README.txt
51
53
  - Rakefile
@@ -229,6 +231,6 @@ rubyforge_project: rspec
229
231
  rubygems_version: 1.3.0
230
232
  signing_key:
231
233
  specification_version: 2
232
- summary: rspec-rails 1.1.8
234
+ summary: rspec-rails 1.1.9
233
235
  test_files: []
234
236