Sha256: 126842e5e875d01400512d450b9b08633de6a68ed888f10359ad23420f0b81fc

Contents?: true

Size: 1.06 KB

Versions: 8

Compression:

Stored size: 1.06 KB

Contents

require_relative '../../spec_helper'
require 'tailor/problem'

describe Tailor::Problem do
  before do
    Tailor::Problem.any_instance.stub(:log)
  end

  let(:lineno) { 10 }
  let(:column) { 11 }

  describe "#set_values" do
    before do
      Tailor::Problem.any_instance.stub(:message)
    end

    it "sets self[:type] to the type param" do
      Tailor::Problem.new(:test, lineno, column, "", :b).
        should include(type: :test)
    end

    it "sets self[:line] to the lineno param" do
      Tailor::Problem.new(:test, lineno, column, "", :c).
        should include(line: lineno)
    end

    it "sets self[:column] to the column param" do
      Tailor::Problem.new(:test, lineno, column, "", :d).
        should include(column: column)
    end

    it "sets self[:message] to the message param" do
      Tailor::Problem.new(:test, lineno, column, "test", :d).
        should include(message: "test")
    end

    it "sets self[:level] to the level param" do
      Tailor::Problem.new(:test, lineno, column, "test", :d).
        should include(level: :d)
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
tailor-1.2.1 spec/unit/tailor/problem_spec.rb
tailor-1.2.0 spec/unit/tailor/problem_spec.rb
tailor-1.1.5 spec/unit/tailor/problem_spec.rb
tailor-1.1.4 spec/unit/tailor/problem_spec.rb
tailor-1.1.3 spec/unit/tailor/problem_spec.rb
tailor-1.1.2 spec/unit/tailor/problem_spec.rb
tailor-1.1.1 spec/unit/tailor/problem_spec.rb
tailor-1.1.0 spec/unit/tailor/problem_spec.rb