Sha256: 4dbcb989a20757254047b475ca9da432bc3a7b7627bd039bd9e38900549c2301

Contents?: true

Size: 1.08 KB

Versions: 41

Compression:

Stored size: 1.08 KB

Contents

require 'spec/runner/formatter/base_text_formatter'

module Spec
  module Runner
    module Formatter
      class SpecdocFormatter < BaseTextFormatter
        def add_example_group(example_group)
          super
          output.puts
          output.puts example_group.description
          output.flush
        end
      
        def example_failed(example, counter, failure)
          message = if failure.expectation_not_met?
            "- #{example.description} (FAILED - #{counter})"
          else
            "- #{example.description} (ERROR - #{counter})"
          end
          
          output.puts(failure.expectation_not_met? ? red(message) : magenta(message))
          output.flush
        end
        
        def example_passed(example)
          message = "- #{example.description}"
          output.puts green(message)
          output.flush
        end
        
        def example_pending(example, message, pending_caller)
          super
          output.puts yellow("- #{example.description} (PENDING: #{message})")
          output.flush
        end
      end
    end
  end
end

Version data entries

41 entries across 41 versions & 10 rubygems

Version Path
dchelimsky-rspec-1.1.10 lib/spec/runner/formatter/specdoc_formatter.rb
dchelimsky-rspec-1.1.11.1 lib/spec/runner/formatter/specdoc_formatter.rb
dchelimsky-rspec-1.1.11.2 lib/spec/runner/formatter/specdoc_formatter.rb
dchelimsky-rspec-1.1.11.3 lib/spec/runner/formatter/specdoc_formatter.rb
dchelimsky-rspec-1.1.11.4 lib/spec/runner/formatter/specdoc_formatter.rb
dchelimsky-rspec-1.1.11.5 lib/spec/runner/formatter/specdoc_formatter.rb
dchelimsky-rspec-1.1.11.6 lib/spec/runner/formatter/specdoc_formatter.rb
dchelimsky-rspec-1.1.11.7 lib/spec/runner/formatter/specdoc_formatter.rb
dchelimsky-rspec-1.1.11 lib/spec/runner/formatter/specdoc_formatter.rb
dchelimsky-rspec-1.1.12 lib/spec/runner/formatter/specdoc_formatter.rb
jnstq-acts_as_sms-0.1.0 test/vendor/plugins/rspec/lib/spec/runner/formatter/specdoc_formatter.rb
jnstq-acts_as_sms-0.1.1 test/vendor/plugins/rspec/lib/spec/runner/formatter/specdoc_formatter.rb
jnstq-acts_as_sms-0.1.3 test/vendor/plugins/rspec/lib/spec/runner/formatter/specdoc_formatter.rb
jnstq-acts_as_sms-0.1.4 test/vendor/plugins/rspec/lib/spec/runner/formatter/specdoc_formatter.rb
newbamboo-evented-rspec-1.1.12 lib/spec/runner/formatter/specdoc_formatter.rb
newbamboo-rspec-1.1.12 lib/spec/runner/formatter/specdoc_formatter.rb
merb-core-1.1.3 spec10/public/webrat/test_app/gems/gems/rspec-1.1.11/lib/spec/runner/formatter/specdoc_formatter.rb
merb-core-1.1.2 spec10/public/webrat/test_app/gems/gems/rspec-1.1.11/lib/spec/runner/formatter/specdoc_formatter.rb
merb-core-1.1.1 spec10/public/webrat/test_app/gems/gems/rspec-1.1.11/lib/spec/runner/formatter/specdoc_formatter.rb
merb-core-1.1.0 spec10/public/webrat/test_app/gems/gems/rspec-1.1.11/lib/spec/runner/formatter/specdoc_formatter.rb