+ Upgrades our code to a recent rspec

master
Kaspar Schiess 2010-12-30 13:46:06 +01:00
parent 36904e208a
commit 9a0da07f73
4 changed files with 7 additions and 7 deletions

View File

@ -5,6 +5,6 @@ gem 'hoe-git'
group :development do group :development do
gem 'metaid' gem 'metaid'
gem 'rspec' gem 'rspec', '~> 2.0'
gem 'flexmock' gem 'flexmock'
end end

View File

@ -26,4 +26,4 @@ DEPENDENCIES
hoe hoe
hoe-git hoe-git
metaid metaid
rspec rspec (~> 2.0)

View File

@ -1,6 +1,5 @@
require 'net/ldap' require 'net/ldap'
require 'rubygems'
Spec::Runner.configure do |config| RSpec.configure do |config|
config.mock_with :flexmock config.mock_with :flexmock
end end

View File

@ -4,12 +4,13 @@ require 'net/ber'
require 'net/ldap' require 'net/ldap'
describe "BER encoding of" do describe "BER encoding of" do
def properly_encode_and_decode
simple_matcher('properly encode and decode') do |given| RSpec::Matchers.define :properly_encode_and_decode do
match do |given|
given.to_ber.read_ber.should == given given.to_ber.read_ber.should == given
end end
end end
context "arrays" do context "arrays" do
it "should properly encode/decode []" do it "should properly encode/decode []" do
[].should properly_encode_and_decode [].should properly_encode_and_decode