Sha256: f87d48b342314eb5cea8305203037ad15b14bf14f84d62623cd871426ed39f64

Contents?: true

Size: 564 Bytes

Versions: 9

Compression:

Stored size: 564 Bytes

Contents

Net::SMTP=Class.new

class Net::SMTP # don't *really* send messages--this is just a stub
    def initialize(hostname, port)
        @@hostname=hostname
        @@port=port
    end

    def self.start(hostname, port, localhostname="localhost")
        @started=true
        yield(self.new(hostname,port)) if block_given?
    end

    def send_message(message, from, to)
        @@from=from
        @@to=to
        @@message=message
    end

    %w{from to message hostname port}.each do |attrib| 
        instance_eval "def #{attrib}; @@#{attrib} end"
    end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
sugoi-mail-0.0.0 test/mocks/test/net-smtp-stub.rb
sugoi-mail-0.1.0 test/mocks/test/net-smtp-stub.rb
sugoi-mail-0.1.5 test/mocks/test/net-smtp-stub.rb
sugoi-mail-0.0.1 test/mocks/test/net-smtp-stub.rb
sugoi-mail-0.0.5 test/mocks/test/net-smtp-stub.rb
sugoi-mail-0.0.2 test/mocks/test/net-smtp-stub.rb
sugoi-mail-0.0.3 test/mocks/test/net-smtp-stub.rb
sugoi-mail-0.3.2 test/mocks/test/net-smtp-stub.rb
sugoi-mail-0.3.0 test/mocks/test/net-smtp-stub.rb