Sha256: dd45699b88101f44262182083e33db9d148bdd5dd6578593ac28528a90c4b258

Contents?: true

Size: 549 Bytes

Versions: 1

Compression:

Stored size: 549 Bytes

Contents

module RSpec
  module ExpectIt
    module ExpectationTargets
      class ExpectIt
        attr_accessor :context, :subject

        def initialize(context, subject = nil)
          self.context = context
          self.subject = subject
        end

        def to(matcher)
          context.expect(get_subject).to(matcher)
        end

        def to_not(matcher)
          context.expect(get_subject).to_not(matcher)
        end

        private

        def get_subject
          subject || context.subject
        end
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
rspec-expect_it-2.0.0 lib/rspec/expect_it/expectation_targets/expect_it.rb