rspec-rails 1.1.5 → 1.1.6

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,4 +1,10 @@
1
- === Version 1.1.5
1
+ === Version 1.1.6 / 2008-10-02
2
+
3
+ * 1 bug fix
4
+
5
+ * fixed regression where values assigned to the assigns hash were not accessible from the example (#549)
6
+
7
+ === Version 1.1.5 / 2008-09-28
2
8
 
3
9
  IMPORTANT: use 'script/autospec' (or just 'autospec' if you have the rspec gem
4
10
  installed) instead of 'autotest'. We changed the way autotest discovers rspec
data/Rakefile CHANGED
@@ -16,7 +16,6 @@ Hoe.new('rspec-rails', Spec::Rails::VERSION::STRING) do |p|
16
16
  p.rubyforge_name = 'rspec'
17
17
  p.developer('RSpec Development Team', 'rspec-devel@rubyforge.org')
18
18
  p.extra_deps = [["rspec","1.1.5"]]
19
- p.spec_extras = { :to_ruby => lambda { |str| File.open("rspec-rails.gemspec", "w+"){ |f| f.puts str } } }
20
19
  end
21
20
 
22
21
  ['audit','test','test_deps','default','publish_docs','post_blog', 'release'].each do |task|
@@ -3,26 +3,20 @@ module Spec
3
3
  module Example
4
4
  class AssignsHashProxy #:nodoc:
5
5
  def initialize(example_group, &block)
6
- @block = block
6
+ @target = block.call
7
7
  @example_group = example_group
8
8
  end
9
9
 
10
- def [](ivar)
11
- if assigns.include?(ivar.to_s)
12
- assigns[ivar.to_s]
13
- elsif assigns.include?(ivar)
14
- assigns[ivar]
15
- else
16
- nil
17
- end
10
+ def [](key)
11
+ assigns[key] || assigns[key.to_s] || @target.instance_variable_get("@#{key}")
18
12
  end
19
13
 
20
- def []=(ivar, val)
21
- @block.call.instance_variable_set("@#{ivar}", val)
14
+ def []=(key, val)
15
+ @target.instance_variable_set("@#{key}", val)
22
16
  end
23
17
 
24
- def delete(name)
25
- assigns.delete(name.to_s)
18
+ def delete(key)
19
+ assigns.delete(key.to_s)
26
20
  end
27
21
 
28
22
  def each(&block)
@@ -4,11 +4,11 @@ module Spec
4
4
  unless defined? MAJOR
5
5
  MAJOR = 1
6
6
  MINOR = 1
7
- TINY = 5
7
+ TINY = 6
8
8
 
9
9
  STRING = [MAJOR, MINOR, TINY].join('.')
10
10
 
11
- SUMMARY = "rspec-rails version #{STRING}"
11
+ SUMMARY = "rspec-rails #{STRING}"
12
12
  end
13
13
  end
14
14
  end
@@ -1,6 +1,6 @@
1
1
  require File.dirname(__FILE__) + '/../../spec_helper'
2
2
  require File.join(File.dirname(__FILE__), *%w[.. .. .. lib autotest rails_rspec])
3
- require File.join(File.dirname(__FILE__), *%w[.. .. .. .. rspec spec autotest_matchers])
3
+ require File.join(File.dirname(__FILE__), *%w[.. .. .. .. rspec spec autotest autotest_matchers])
4
4
 
5
5
  describe Autotest::RailsRspec, "file mapping" do
6
6
  before(:each) do
@@ -62,4 +62,9 @@ describe "AssignsHashProxy" do
62
62
  @proxy.has_key?('foo').should == true
63
63
  @proxy.has_key?('bar').should == false
64
64
  end
65
+
66
+ it "should expose values set in example" do
67
+ @proxy[:foo] = 'bar'
68
+ @proxy[:foo].should == 'bar'
69
+ end
65
70
  end
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.5
4
+ version: 1.1.6
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-09-28 00:00:00 -05:00
12
+ date: 2008-10-02 00:00:00 -05:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
@@ -226,9 +226,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
226
226
  requirements: []
227
227
 
228
228
  rubyforge_project: rspec
229
- rubygems_version: 1.2.0
229
+ rubygems_version: 1.3.0
230
230
  signing_key:
231
231
  specification_version: 2
232
- summary: rspec-rails version 1.1.5
232
+ summary: rspec-rails 1.1.6
233
233
  test_files: []
234
234