Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Update to work with rspec 2.1.0.

  • Loading branch information...
commit 965c0b2ba785f4561776b8e6bb7ac97c91dcfa05 1 parent 851160b
@glv authored
Showing with 16 additions and 23 deletions.
  1. +1 −1  Gemfile
  2. +9 −11 Gemfile.lock
  3. +1 −1  Rakefile
  4. +5 −10 lib/rspec/unit/test_case.rb
View
2  Gemfile
@@ -1,7 +1,7 @@
source :gemcutter
# gem 'bundler', '>= 0.9.16'
-gem 'rspec', '= 2.0.1'
+gem 'rspec', '= 2.1.0'
group :test do
gem 'rake', '>= 0.8.7'
View
20 Gemfile.lock
@@ -10,16 +10,14 @@ GEM
rubyforge (>= 2.0.0)
json_pure (1.4.6)
rake (0.8.7)
- rspec (2.0.1)
- rspec-core (~> 2.0.1)
- rspec-expectations (~> 2.0.1)
- rspec-mocks (~> 2.0.1)
- rspec-core (2.0.1)
- rspec-expectations (2.0.1)
- diff-lcs (>= 1.1.2)
- rspec-mocks (2.0.1)
- rspec-core (~> 2.0.1)
- rspec-expectations (~> 2.0.1)
+ rspec (2.1.0)
+ rspec-core (~> 2.1.0)
+ rspec-expectations (~> 2.1.0)
+ rspec-mocks (~> 2.1.0)
+ rspec-core (2.1.0)
+ rspec-expectations (2.1.0)
+ diff-lcs (~> 1.1.2)
+ rspec-mocks (2.1.0)
rubyforge (2.0.4)
json_pure (>= 1.1.7)
@@ -30,4 +28,4 @@ PLATFORMS
DEPENDENCIES
jeweler (>= 1.4.0)
rake (>= 0.8.7)
- rspec (= 2.0.1)
+ rspec (= 2.1.0)
View
2  Rakefile
@@ -10,7 +10,7 @@ begin
gem.homepage = "http://github.com/glv/rspec-unit"
gem.authors = ["Glenn Vanderburg"]
gem.rubyforge_project = "rspec-unit"
- gem.add_dependency('rspec', '~> 2.0')
+ gem.add_dependency('rspec', '~> 2.1')
gem.has_rdoc = false
gem.files = FileList["[A-Z]*", "{bin,lib,spec}/**/*"].exclude('**/*.rbc')
gem.rubyforge_project = 'glv'
View
15 lib/rspec/unit/test_case.rb
@@ -23,11 +23,8 @@ def self.inherited(klass)
install_setup_and_teardown(klass)
- klass.set_it_up(test_case_name(klass))
- md = klass.metadata
- md[:example_group][:test_unit] = true
- md[:example_group][:file_path], md[:example_group][:line_number] = md.send(:file_and_line_number_from, caller)
- md[:example_group][:location] = md.send(:location_from, md[:example_group])
+ klass.set_it_up(test_case_name(klass), {:caller => caller})
+ klass.metadata[:example_group][:test_unit] = true
children << klass
world.example_groups << klass
end
@@ -107,12 +104,10 @@ def self.number_of_tests
def self.tests
@tests ||= test_methods.sort.map do |m|
- meta = (test_method_metadata[m] || {}).merge({:full_description => "#{display_name}##{m}",
+ meta = (test_method_metadata[m] || {}).merge({:caller => find_caller_lines(m),
+ :full_description => "#{display_name}##{m}",
:test_unit => true})
- example = Core::Example.new(self, m, meta, proc{execute(m)})
- example.metadata[:file_path], example.metadata[:line_number] = example.metadata.send(:file_and_line_number_from, find_caller_lines(m))
- example.metadata[:location] = example.metadata.send(:location_from, example.metadata)
- example
+ Core::Example.new(self, m, meta, proc{execute(m)})
end
end
Please sign in to comment.
Something went wrong with that request. Please try again.