# frozen_string_literal: true

RSpec.describe Neat::Node do
  describe 'attributes' do
    subject(:node) { described_class.new(id: 1, type: :input) }

    it { is_expected.to have_attributes(id: 1, type: :input) }
  end

  describe 'type methods' do
    let(:input) { described_class.new(id: 1, type: :input) }
    let(:hidden) { described_class.new(id: 1, type: :hidden) }
    let(:output) { described_class.new(id: 1, type: :output) }

    describe '#input?' do
      it { expect(input).to be_input }
      it { expect(hidden).not_to be_input }
      it { expect(output).not_to be_input }
    end

    describe '#hidden?' do
      it { expect(input).not_to be_hidden }
      it { expect(hidden).to be_hidden }
      it { expect(output).not_to be_hidden }
    end

    describe '#output?' do
      it { expect(input).not_to be_output }
      it { expect(output).to be_output }
      it { expect(hidden).not_to be_output }
    end
  end
end
