Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 925433
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T19:31:12+00:00 2026-05-15T19:31:12+00:00

require ‘rubygems’ require ‘test/unit’ class Thing attr_accessor :foo def set_stuff @foo = ‘bar’ end

  • 0
require 'rubygems'
require 'test/unit'

class Thing
  attr_accessor :foo

  def set_stuff
    @foo = 'bar'
  end
end

class ThingTest < Test::Unit::TestCase
  def setup
    @thing = Thing.new
  end

  def test_set_stuff
    @thing.set_stuff
    assert 'bar' == @thing.foo
  end

  def test_foo_in_other_test
    puts @thing.foo
    assert 'bar' == @thing.foo
  end
end


# Loaded suite testing
# Started
# nil
# F.
# Finished in 0.00439 seconds.
#
#   1) Failure:
# test_foo_in_other_test(ThingTest) [testing.rb:26]:
# <false> is not true.
#
# 2 tests, 2 assertions, 1 failures, 0 errors
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T19:31:13+00:00Added an answer on May 15, 2026 at 7:31 pm

    The difference looks to be that you’re not calling @thing.set_stuff in the second test.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 490k
  • Answers 490k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer I think the problem is that your machine is swapping,… May 16, 2026 at 9:58 am
  • Editorial Team
    Editorial Team added an answer I dont think there would be an easier way to… May 16, 2026 at 9:58 am
  • Editorial Team
    Editorial Team added an answer Well, you can use the Connection.GetSchema("TABLES") method. This returns a… May 16, 2026 at 9:58 am

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Related Questions

require 'rubygems' require 'mysql' db = Mysql.connect('localhost', 'root', '', 'mohit') //db.rb:4: undefined method `connect'
require 'rubygems' require 'differ' original = Epic lolcat fail bellmead drive! current = Epic
I require a tree / directed acyclic graph implementation something like this: public class
### Ruby 1.8.7 ### require 'rubygems' require 'oniguruma' # for look-behind Oniguruma::ORegexp.new('h(?=\w*)') # =>
require 'pp' p *1..10 This prints out 1-10. Why is this so concise? And
require_once('Class.php'); $myArray = array(1,2,3,4,5,6,7,8,9,10,11,12,13,14,15); // etc which is correct? foreach($myArray as $key => $val)
require 'sketchup' entities = Sketchup.active_model.entities summa = Hash.new for face in entities next unless
I require a star rating control (which allows partial rating like 4.5) for my
We require a script that simulates associative arrays or map-like data structure for shell
my code- require 'database.php'; $title = mysql_real_escape_string($_POST['title']); //line 48 $cat = $_POST['cat']; $txtart =

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.