Sha256: 08e1f27926228c4474fa8fac3f7603c1e712441909936fc508456aefc02af68d

Contents?: true

Size: 675 Bytes

Versions: 3

Compression:

Stored size: 675 Bytes

Contents

require 'rspec'
require "rspec/something/version"
require "rspec/something/proxy"

RSpec.configure do |config|
  include Rspec::Something
end

module Rspec
  module Something

    # Return something should receive a message.
    #
    # This
    #
    #     UserMailer.should_receive(:hello).and_return something.deliver
    #
    # is same as
    #
    #     mail = double
    #     mail.should_receive :deliver
    #     UserMailer.should_receive(:hello).and_return mail
    #
    # To assert that the message won't be received, insert `won_t` like:
    #
    #    something.won_t.deliver
    #
    def something
      Rspec::Something::Proxy.new(double)
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
rspec-something-0.0.3 lib/rspec/something.rb
rspec-something-0.0.2 lib/rspec/something.rb
rspec-something-0.0.1 lib/rspec/something.rb