Sha256: f4f4680e4e812f5df1d3fdc2f095b2ce6421b3ff7af2ab82664526fabe1ec99c

Contents?: true

Size: 1.12 KB

Versions: 3

Compression:

Stored size: 1.12 KB

Contents

require "spec_helper"
require "xcpretty"
require "xcpretty/formatters/rspec"

module XCPretty

  describe RSpec do

    before(:each) do
      @formatter = RSpec.new(false, false)
    end

    it "prints dots in the same line" do
      @formatter.optional_newline.should == ""
    end

    context "without colors" do

      it "prints green dots for passing tests" do
        @formatter.format_passing_test("sweez testz", "sample spec", "0.002").should == "."
      end

      it "prints F for failing tests" do
        @formatter.format_failing_test(
          "///file", "NSNumber Specs", "adding numbers", "should add 2 numbers"
        ).should == "F"
      end
    end

    context "with colors" do

      before { @formatter.colorize = true }

      it "prints green for passing tests" do
        @formatter.format_passing_test("sweez testz", "sample spec", "0.002"
        ).should be_colored :green
      end

      it "prints red for failing tests" do
        @formatter.format_failing_test(
          "///file", "NSNumber Specs", "adding numbers", "should add 2 numbers"
        ).should be_colored :red
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
xcpretty-0.0.9 spec/xcpretty/formatters/rspec_spec.rb
xcpretty-0.0.8 spec/xcpretty/formatters/rspec_spec.rb
xcpretty-0.0.7 spec/xcpretty/formatters/rspec_spec.rb