Forum: Ruby want to understand the RSpec code.

Cc7107cb48ea5e9d6b096f4c7fdf2bb1?d=identicon&s=25 Selvag Ruby (selvag1005)
on 2014-03-13 08:18
Guide me to get good knowledge in RSpec.
there are two things explained as'RSpec' and 'Cucumber'.

1. Should I learn both of these for testing?
2. What is the forum to RSpec?
3. What's the first to write, .rspec or .rb?
A7fca2db6ff3f4583df98043bd5166f9?d=identicon&s=25 Panagiotis Atmatzidis (Guest)
on 2014-03-13 10:24
(Received via mailing list)
Attachment: signature.asc (832 Bytes)
Hello,

On 13 Μαρ 2014, at 08:18 , Selvag Ruby <lists@ruby-forum.com> wrote:

> Guide me to get good knowledge in RSpec.

The best guide I can think of is writing code and buying a book[1] but
for starters you can start here[2]. There are several tutorials
online[3].

> there are two things explained as'RSpec' and 'Cucumber'.

Cucumber[4] is a testing framework for behavioral driven development
that can work with Rspec. It's somewhat easier, higher level abstraction
compared to Rspec. I'd stick to Rspec for starters though, leaving
Cucumber aside.

>
> 1. Should I learn both of these for testing?

No. If you learn Rspec, cucumber will become self-explainatory.

> 2. What is the forum to RSpec?

No forum, but there's a google group (mailing list) like this one[5].
You can ask rspec questions here though, I'm sure we have experienced
rspec users.

> 3. What's the first to write, .rspec or .rb?

If you don't know ruby you won't be able to write specs, no matter what
the framework is. Rspec is used by Rails people mostly, that's why
you'll find lots of Rspec-Rails related tutorials online. Ruby uses the
minitest framework which is equally powerful. If you are going to use
pure ruby and not rails/sinatra I'd say go with MiniTest instead of
Rspec. However, once you get your way through either of those, the other
will come very easy. All you need to learn is the syntax and methods of
each testing framework.

Although in BDD or TDD you write test FIRST for the to fail and THEN you
write the code to PASS them, you have to be familiar with basic ruby
concepts, otherwise there's no point in pursuing TDD/BDD. These are
somewhat the third step the first two being:

1. Learn ruby basics
2. Learn to write programs in ruby that do useful things
and only then...
3. consider TDD because is a very good practice in production and will
help you avoid buggy code.

Best regards,

>
> --
> Posted via http://www.ruby-forum.com/.


[1] http://pragprog.com/book/achbd/the-rspec-book - This book was the
first come out on Google, I have not read it or have any affiliation.
[2] http://rspec.info/
[3]
http://blog.davidchelimsky.net/blog/2007/05/14/an-...
http://blog.teamtreehouse.com/an-introduction-to-rspec
http://code.tutsplus.com/tutorials/ruby-for-newbie...
[4] http://cukes.info/
[5] https://groups.google.com/forum/#!forum/rspec


Panagiotis (atmosx) Atmatzidis

email:  atma@convalesco.org
URL:  http://www.convalesco.org
GnuPG ID: 0x1A7BFEC5
gpg --keyserver pgp.mit.edu --recv-keys 1A7BFEC5

"The fool doth think he is wise, but the wise man knows himself to be a
fool." - William Shakespeare
Please log in before posting. Registration is free and takes only a minute.
Existing account

NEW: Do you have a Google/GoogleMail, Yahoo or Facebook account? No registration required!
Log in with Google account | Log in with Yahoo account | Log in with Facebook account
No account? Register here.