Sha256: 3f3db0b2e36e4dd2ed1874a36eb61227b72d1793473b96c301b10227ce229d50

Contents?: true

Size: 626 Bytes

Versions: 6

Compression:

Stored size: 626 Bytes

Contents

module Hexx
  describe Message do

    let!(:message) { Message.new type: "info", text: "" }

    describe ".new" do

      it "requires type" do
        expect { Message.new text: "" }.to raise_error
      end

      it "requires text" do
        expect { Message.new type: "" }.to raise_error
      end
    end

    describe "#type=" do

      it "sets the type" do
        expect { message.type = :error }.to change { message.type }.to "error"
      end
    end

    describe "#text=" do

      it "sets the text" do
        expect { message.text = "Text" }.to change { message.text }.to "Text"
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
hexx-1.1.1 spec/hexx/message_spec.rb
hexx-1.1.0 spec/hexx/message_spec.rb
hexx-1.0.2 spec/hexx/message_spec.rb
hexx-1.0.1 spec/hexx/message_spec.rb
hexx-1.0.0 spec/hexx/message_spec.rb
hexx-0.1.1 spec/hexx/message_spec.rb