Sha256: a7de54873fe84cab93909371e6b40f1b9e413246b1988a2ffccb52ae006b1762

Contents?: true

Size: 1.4 KB

Versions: 15

Compression:

Stored size: 1.4 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 dots for passing tests" do
        @formatter.format_passing_test("sweez testz", "sample spec", "0.002").should == "."
      end

      it "prints P for pending tests" do
        @formatter.format_pending_test("sweez testz", "sample spec").should == "P"
      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 yellow for pending tests" do
        @formatter.format_pending_test("sweez testz", "sample spec"
        ).should be_colored :yellow
      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

15 entries across 15 versions & 2 rubygems

Version Path
learn-xcpretty-0.1.12 spec/xcpretty/formatters/rspec_spec.rb
xcpretty-0.1.12 spec/xcpretty/formatters/rspec_spec.rb
xcpretty-0.1.11 spec/xcpretty/formatters/rspec_spec.rb
xcpretty-0.1.10 spec/xcpretty/formatters/rspec_spec.rb
learn-xcpretty-0.1.11 spec/xcpretty/formatters/rspec_spec.rb
xcpretty-0.1.9 spec/xcpretty/formatters/rspec_spec.rb
xcpretty-0.1.8 spec/xcpretty/formatters/rspec_spec.rb
xcpretty-0.1.7 spec/xcpretty/formatters/rspec_spec.rb
xcpretty-0.1.6 spec/xcpretty/formatters/rspec_spec.rb
xcpretty-0.1.5 spec/xcpretty/formatters/rspec_spec.rb
xcpretty-0.1.4 spec/xcpretty/formatters/rspec_spec.rb
xcpretty-0.1.3 spec/xcpretty/formatters/rspec_spec.rb
xcpretty-0.1.2 spec/xcpretty/formatters/rspec_spec.rb
xcpretty-0.1.1 spec/xcpretty/formatters/rspec_spec.rb
xcpretty-0.1.0 spec/xcpretty/formatters/rspec_spec.rb