new to ruby and trying to minitest

47 views
Skip to first unread message

Justin Cheeze

unread,
Jan 21, 2015, 7:21:06 PM1/21/15
to rubyonra...@googlegroups.com
i recreated a test directory, and placed all the necessary files in the
directory.

replaced gem 'minitest' with
gem 'minitest-rails', '~> 0.1.0.alpha'
I replaced coz I was getting in error in the terminal which reads
Could not find generator mini_test:install
therefore, again, I replaced and bundled. it then proceeded to create
test/minitest_helper.rb

anyway.

i run the first test which is

require "minitest/autorun"
require "minitest/rails"

class ExercisesTest < ActionController::TestCase

test "should get show" do
get :show
assert_response :success
end

end

and the output from the terminal reads

Errors running test:units! #<NoMethodError: undefined method `[]' for
nil:NilClass>

I need some hand holding setting up the directory now. what to test, and
how to write tests. I'm not looking just to get tests to pass ( I am)
but I'm wanting to know what the fuck I'm doing, really. None of this
half assed shit, ya know?

be well.

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

Bala Paranj

unread,
Jan 22, 2015, 1:48:14 AM1/22/15
to rubyonra...@googlegroups.com
If you don't know what you are doing, then learn the basics. Here is a free coupon for TDD in Ruby course for beginners: https://www.udemy.com/learn-test-driven-development-in-ruby/?couponCode=railsfree

Colin Law

unread,
Jan 22, 2015, 4:16:50 AM1/22/15
to rubyonra...@googlegroups.com
On 22 January 2015 at 00:20, Justin Cheeze <li...@ruby-forum.com> wrote:
> ...
> I need some hand holding setting up the directory now. what to test, and
> how to write tests. I'm not looking just to get tests to pass ( I am)
> but I'm wanting to know what the fuck I'm doing, really. None of this
> half assed shit, ya know?

I suggest working right through a good tutorial such as
railstutorial.org (which is free to use online). That will show you
the basics of rails including tests.

Colin

Justin Cheeze

unread,
Jan 22, 2015, 7:34:09 AM1/22/15
to rubyonra...@googlegroups.com
I've been working on that tutorial but still confused. thanks for
reaching out.

Colin Law

unread,
Jan 22, 2015, 11:11:28 AM1/22/15
to rubyonra...@googlegroups.com
On 22 January 2015 at 12:33, Justin Cheeze <li...@ruby-forum.com> wrote:
> I've been working on that tutorial but still confused. thanks for
> reaching out.

Where on the tutorial are you confused?

Colin

Justin Cheeze

unread,
Jan 22, 2015, 11:16:39 AM1/22/15
to rubyonra...@googlegroups.com
control flow. learning how to think. like, obviously I know exactly what
this test is doing

test "should get show" do
get :show
assert_response :success
end

however, when doing other testing on another application to help hone my
craft, I have no idea what the heels I'm doing.

thanks for reaching out. take care.

Colin Law

unread,
Jan 22, 2015, 11:23:05 AM1/22/15
to rubyonra...@googlegroups.com
On 22 January 2015 at 16:15, Justin Cheeze <li...@ruby-forum.com> wrote:
> control flow. learning how to think. like, obviously I know exactly what
> this test is doing
>
> test "should get show" do
> get :show
> assert_response :success
> end
>
> however, when doing other testing on another application to help hone my
> craft, I have no idea what the heels I'm doing.

Finish the tutorial first, doing all the exercises, see if that helps.

Colin

Justin Cheeze

unread,
Jan 22, 2015, 11:25:20 AM1/22/15
to rubyonra...@googlegroups.com
ok, I will.

thanks again for reaching out. it's appreciated.
Reply all
Reply to author
Forward
0 new messages