Sha256: 7486911cf5e728fd9950f83e5edbb3d2fb3bf2356801a1890de2e28775ea443a
Contents?: true
Size: 713 Bytes
Versions: 16
Compression:
Stored size: 713 Bytes
Contents
class RSpecRemote def self.run_describe_block(describe_block) temp_path = nil Tempfile.open(['example', '_spec.rb']) do |io| io.write(<<-spec) require 'spec_helper'; #{describe_block} spec temp_path = io.path end `rake SPEC=#{temp_path} 2>&1` end end RSpecCandy::Switcher.define_matcher :pass_as_describe_block do match do |describe_block| rspec_out = RSpecRemote.run_describe_block(describe_block) rspec_out.include?('0 failures') end end RSpecCandy::Switcher.define_matcher :fail_as_describe_block do match do |describe_block| rspec_out = RSpecRemote.run_describe_block(describe_block) rspec_out.include?('1 failure') end end
Version data entries
16 entries across 16 versions & 1 rubygems