On Tue, May 26, 2015 at 6:24 AM, Alexander Karsten <
[email protected]> wrote:

> Hello,
>
> I am trying to learn RSpec by building a connect four game. I have a board
> class, that stores the game board as an array and I'm trying to validate
> the dimensions of the array.
> However I feel like im going horribly wrong here and hours of googling
> were to no help.
>
> How do I do this right?
>
>   context "board array" do
>     specify { expect(subject.board).to be_a Array }
>
>     specify { expect(subject.board.length).to eq 6 }
>
>     specify { expect(subject.board.all? { |row| row.length == 7 }).to
> be_truthy }
>   end
>
> Thank you very much for your time.
>


What you have there looks fine, assuming that's nested in some parent
example group that defines `subject`.  What problem are you having with
what you've written?  If you're getting a failure, please paste it in a
reply, including the stack trace.

Myron

-- 
You received this message because you are subscribed to the Google Groups 
"rspec" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/rspec/CADUxQmuSs8G8HnHdZvugoRHvh0mbhSOucN144UQSSp%2BtMBpUGg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to