README.md in tcr-0.0.5 vs README.md in tcr-0.1.0
- old
+ new
@@ -1,14 +1,11 @@
# TCR (TCP + VCR)
[![Build Status](https://travis-ci.org/robforman/tcr.png?branch=master)](https://travis-ci.org/robforman/tcr)
-[ ![Codeship Status for SalesLoft/melody](https://www.codeship.io/projects/9fcbda40-6859-0132-9920-3ad5c353d440/status?branch=master)](https://www.codeship.io/projects/53337)
-
-
TCR is a *very* lightweight version of [VCR](https://github.com/vcr/vcr) for TCP sockets.
Currently used for recording 'net/smtp' interactions so only a few of the TCPSocket methods are recorded out.
## Installation
@@ -31,19 +28,19 @@
require 'test/unit'
require 'tcr'
TCR.configure do |c|
c.cassette_library_dir = 'fixtures/tcr_cassettes'
- c.hook_tcp_ports = [25]
+ c.hook_tcp_ports = [2525]
end
class TCRTest < Test::Unit::TestCase
def test_example_dot_com
- TCR.use_cassette('google_smtp') do
- tcp_socket = TCPSocket.open("aspmx.l.google.com", 25)
+ TCR.use_cassette('mandrill_smtp') do
+ tcp_socket = TCPSocket.open("smtp.mandrillapp.com", 2525)
io = Net::InternetMessageIO.new(tcp_socket)
- assert_match /220 mx.google.com ESMTP/, io.readline
+ assert_match /220 smtp.mandrillapp.com ESMTP/, io.readline
end
end
end
```
@@ -52,11 +49,11 @@
```json
[
[
[
"read",
- "220 mx.google.com ESMTP x3si2474860qas.18 - gsmtp\r\n"
+ "220 smtp.mandrillapp.com ESMTP\r\n"
]
]
]
```
@@ -64,10 +61,10 @@
You can disable TCR hooking TCPSocket ports for a given block via `turned_off`:
```ruby
TCR.turned_off do
- tcp_socket = TCPSocket.open("aspmx.l.google.com", 25)
+ tcp_socket = TCPSocket.open("smtp.mandrillapp.com", 2525)
end
```
## Contributing