Skip to content

Commit 4f29d7d

Browse files
author
Jerry Cheung
committed
use flexmock for now
since we're not moving away from flexmock just yet, I updated my tests to use flexmock to be consistent. cc @mtodd
1 parent 2594ebb commit 4f29d7d

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

test/test_helper.rb

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
require 'test/unit'
33
require 'net/ldap'
44
require 'flexmock/test_unit'
5-
require 'minitest/mock'
65

76
# Whether integration tests should be run.
87
INTEGRATION = ENV.fetch("INTEGRATION", "skip") != "skip"

test/test_ldap_connection.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,15 +44,15 @@ def test_modify_ops_replace
4444
end
4545

4646
def test_write
47-
mock = Minitest::Mock.new
48-
mock.expect(:write, true, [[1.to_ber, "request"].to_ber_sequence])
47+
mock = flexmock("socket")
48+
mock.should_receive(:write).with([1.to_ber, "request"].to_ber_sequence).and_return(true)
4949
conn = Net::LDAP::Connection.new(:socket => mock)
5050
conn.send(:write, "request")
5151
end
5252

5353
def test_write_with_controls
54-
mock = Minitest::Mock.new
55-
mock.expect(:write, true, [[1.to_ber, "request", "controls"].to_ber_sequence])
54+
mock = flexmock("socket")
55+
mock.should_receive(:write).with([1.to_ber, "request", "controls"].to_ber_sequence).and_return(true)
5656
conn = Net::LDAP::Connection.new(:socket => mock)
5757
conn.send(:write, "request", "controls")
5858
end

0 commit comments

Comments
 (0)