Sha256: 44824af396d7cb8f9ed15934872cc94c802d76575677eb4d6b78e619d0db4373

Contents?: true

Size: 814 Bytes

Versions: 9

Compression:

Stored size: 814 Bytes

Contents

require 'test_helper'

module Pelusa
  describe SuccessfulAnalysis do
    before do
      @analysis = SuccessfulAnalysis.new("Is awesome")
    end

    it 'is successful' do
      @analysis.successful?.must_equal true
    end

    describe '#message' do
      it 'has an empty message' do
        @analysis.message.empty?.must_equal true
      end
    end
  end

  describe FailedAnalysis do
    before do
      number_of_errors = 42
      @analysis = FailedAnalysis.new("Is awesome", number_of_errors) do |errors|
        "There have been #{errors} errors."
      end
    end

    it 'is failed' do
      @analysis.failed?.must_equal true
    end

    describe '#message' do
      it 'describes the failed analysis' do
        @analysis.message.must_equal "There have been 42 errors."
      end
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
pelusa-0.2.4 test/pelusa/analysis_test.rb
pelusa-0.2.3 test/pelusa/analysis_test.rb
pelusa-0.2.2 test/pelusa/analysis_test.rb
pelusa-0.2.1 test/pelusa/analysis_test.rb
pelusa-0.2.0 test/pelusa/analysis_test.rb
pelusa-0.1.1 test/pelusa/analysis_test.rb
pelusa-0.1.0 test/pelusa/analysis_test.rb
pelusa-0.0.2 test/pelusa/analysis_test.rb
pelusa-0.0.1 test/pelusa/analysis_test.rb