Sha256: 98b46d253f6a9ccf5e91013da579a290bd8c2c83596addc31bae9c7d93eff82f

Contents?: true

Size: 941 Bytes

Versions: 1

Compression:

Stored size: 941 Bytes

Contents

# encoding: utf-8
require "spec_helper"

describe Lumos::Wrapper do
  context "position" do
    it "returns surround if position was not defined" do
      expect(described_class.new("Aguamenti").position).to eq(:surround)
    end

    it "raises an ArgumentError exception if wrong position defined" do
      expect { described_class.new("Avada Kedavra", {position: :unknown}) }.to raise_error(ArgumentError)
    end
  end

  context "service methods" do
    it "instantiates class based on defined position" do
      expect(described_class.new("Alohomora", {position: :left}).formatter.class).to eq(Lumos::Formatters::Left)
    end
  end

  context "missing methods" do
    it "returns left positioned message" do
      expect(described_class.new("Anapneo").left).to eq("# Anapneo")
    end

    it "returns bottom positioned message" do
      expect(described_class.new("Aparecium").bottom).to eq("Aparecium\n#########")
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
lumos-0.0.1 spec/wrapper_spec.rb