Sha256: 0632198e19fd4ff2c840b058eced4605c06ef4f952d0f8a4a4974eedf4dc1a07

Contents?: true

Size: 614 Bytes

Versions: 4

Compression:

Stored size: 614 Bytes

Contents

class RSpecRemote
  def self.run_example(example)
    run_describe_block(<<-describe_block)
      describe 'context' do
        it 'should pass' do
          #{example}
        end
      end
    describe_block
  end
end


RSpecCandy::Switcher.define_matcher :pass_as_example do

  match do |example|
    rspec_out = RSpecRemote.run_example(example)
    # puts rspec_out
    rspec_out.include?('0 failures')
  end

end

RSpecCandy::Switcher.define_matcher :fail_as_example do

  match do |example|
    rspec_out = RSpecRemote.run_example(example)
    # puts rspec_out
    rspec_out.include?('1 failure')
  end

end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
rspec_candy-0.5.1 spec/support/matchers/pass_as_example.rb
rspec_candy-0.5.0 spec/support/matchers/pass_as_example.rb
rspec_candy-0.4.1 spec/support/matchers/pass_as_example.rb
rspec_candy-0.4.0 spec/support/matchers/pass_as_example.rb