Sha256: af02727edadbfc0a282f975fe7e246670aadc1272308bd88bf41972c5ae703bd
Contents?: true
Size: 1.24 KB
Versions: 47
Compression:
Stored size: 1.24 KB
Contents
require "spec_helper" describe "failed_results_re for autotest" do def run_example group = RSpec::Core::ExampleGroup.describe("group") group.example("example") { yield } io = StringIO.new formatter = RSpec::Core::Formatters::BaseTextFormatter.new(io) reporter = RSpec::Core::Reporter.new(formatter) group.run(reporter) reporter.report(1, nil) {} io.string end shared_examples "autotest failed_results_re" do it "matches a failure" do output = run_example { fail } expect(output).to match(Autotest::Rspec2.new.failed_results_re) expect(output).to include(__FILE__.sub(File.expand_path('.'),'.')) end it "does not match when there are no failures" do output = run_example { } # pass expect(output).not_to match(Autotest::Rspec2.new.failed_results_re) expect(output).not_to include(__FILE__.sub(File.expand_path('.'),'.')) end end context "with color enabled" do before do RSpec.configuration.stub(:color_enabled? => true) end include_examples "autotest failed_results_re" end context "with color disabled " do before do RSpec.configuration.stub(:color_enabled? => false) end include_examples "autotest failed_results_re" end end
Version data entries
47 entries across 47 versions & 13 rubygems