Skip to content

Commit 4d01a2e

Browse files
committed
Merge pull request #111 from jch/fix-spec-deprecations
Fix spec deprecations
2 parents 449370b + 6dd3ced commit 4d01a2e

File tree

3 files changed

+9
-10
lines changed

3 files changed

+9
-10
lines changed

spec/unit/ber/ber_spec.rb

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -90,8 +90,7 @@
9090
raw_string("\x04\x10" + "j1\xB4\xA1*\xA2zA\xAC\xA9`?'\xDDQ\x16")
9191
end
9292
it "should not fail on strings that can not be converted to UTF-8" do
93-
error = Encoding::UndefinedConversionError
94-
lambda {"\x81".to_ber }.should_not raise_exception(error)
93+
expect { "\x81".to_ber }.not_to raise_error
9594
end
9695
end
9796
end
@@ -120,21 +119,21 @@
120119
context "binary data" do
121120
let(:data) { ["6a31b4a12aa27a41aca9603f27dd5116"].pack("H*").force_encoding("ASCII-8BIT") }
122121

123-
its(:valid_encoding?) { should be_true }
122+
specify { subject.valid_encoding?.should == true }
124123
specify { subject.encoding.name.should == "ASCII-8BIT" }
125124
end
126125

127126
context "ascii data in UTF-8" do
128127
let(:data) { "some text".force_encoding("UTF-8") }
129128

130-
its(:valid_encoding?) { should be_true }
129+
specify { subject.valid_encoding?.should == true }
131130
specify { subject.encoding.name.should == "UTF-8" }
132131
end
133132

134133
context "UTF-8 data in UTF-8" do
135134
let(:data) { ["e4b8ad"].pack("H*").force_encoding("UTF-8") }
136-
137-
its(:valid_encoding?) { should be_true }
135+
136+
specify { subject.valid_encoding?.should == true }
138137
specify { subject.encoding.name.should == "UTF-8" }
139138
end
140139
end

spec/unit/ldap/search_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ def search(args)
2323
context "when :return_result => false" do
2424
it "should return false upon error" do
2525
result = @connection.search(:return_result => false)
26-
result.should be_false
26+
result.should == false
2727
end
2828
end
2929

spec/unit/ldap_spec.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,10 @@
2323
bind_result = flexmock(:bind_result, :success? => true)
2424
@connection.should_receive(:bind).with(Hash).and_return(bind_result)
2525

26-
subject.bind.should be_true
26+
subject.bind.should == true
2727

2828
payload, result = events.pop
29-
result.should be_true
29+
result.should == true
3030
payload[:bind].should == bind_result
3131
end
3232

@@ -38,7 +38,7 @@
3838
yields(entry = Net::LDAP::Entry.new("uid=user1,ou=users,dc=example,dc=com")).
3939
and_return(flexmock(:search_result, :success? => true, :result_code => 0))
4040

41-
subject.search(:filter => "(uid=user1)").should be_true
41+
subject.search(:filter => "(uid=user1)").should_not be_nil
4242

4343
payload, result = events.pop
4444
result.should == [entry]

0 commit comments

Comments
 (0)