Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

adapt to newer rspec #1

Merged
merged 1 commit into from

2 participants

@boutil

hi,

I noticed that files in spec/ use the syntax of old versions of RSpec. Please find here a proposition to update them to a newer version of RSpec2:

  • use 'rspec' instead of 'spec'
  • use be_within instead of be_close.

Thanks!

Cheers,

Cédric

Cédric Boutillier adapt to newer rspec 568cc2d
@clbustos clbustos merged commit 5476bb3 into from
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Dec 10, 2012
  1. adapt to newer rspec

    Cédric Boutillier authored
This page is out of date. Refresh to see the latest.
Showing with 9 additions and 9 deletions.
  1. +6 −6 spec/minimization_unidimensional_spec.rb
  2. +3 −3 spec/spec_helper.rb
View
12 spec/minimization_unidimensional_spec.rb
@@ -14,10 +14,10 @@
@min.iterate
end
it "#x_minimum be close to expected" do
- @min.x_minimum.should be_close(@p1,@min.epsilon)
+ @min.x_minimum.should be_within(@min.epsilon).of(@p1)
end
it "#f_minimum ( f(x)) be close to expected" do
- @min.f_minimum.should be_close(@p2,@min.epsilon)
+ @min.f_minimum.should be_within(@min.epsilon).of(@p2)
end
context "#log" do
subject {@min.log}
@@ -32,10 +32,10 @@
@min = Minimization::GoldenSection.minimize(-1000,1000, &@func)
end
it "#x_minimum be close to expected" do
- @min.x_minimum.should be_close(@p1,@min.epsilon)
+ @min.x_minimum.should be_within(@min.epsilon).of(@p1)
end
it "#f_minimum ( f(x)) be close to expected" do
- @min.f_minimum.should be_close(@p2,@min.epsilon)
+ @min.f_minimum.should be_within(@min.epsilon).of(@p2)
end
context "#log" do
subject {@min.log}
@@ -48,10 +48,10 @@
@min = Minimization::Brent.minimize(-1000,1000, &@func)
end
it "should x be correct" do
- @min.x_minimum.should be_close(@p1,@min.epsilon)
+ @min.x_minimum.should be_within(@min.epsilon).of(@p1)
end
it "should f(x) be correct" do
- @min.f_minimum.should be_close(@p2,@min.epsilon)
+ @min.f_minimum.should be_within(@min.epsilon).of(@p2)
end
context "#log" do
subject {@min.log}
View
6 spec/spec_helper.rb
@@ -1,10 +1,10 @@
$LOAD_PATH.unshift(File.dirname(__FILE__))
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
require 'minimization.rb'
-require 'spec'
-require 'spec/autorun'
+require 'rspec'
+require 'rspec/autorun'
-Spec::Runner.configure do |config|
+RSpec.configure do |config|
end
Something went wrong with that request. Please try again.