title: rspec - why does this assert_equal comparison test work on a mac and not on Ubuntu?
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/12791943/rspec-why-does-this-attribute-comparison-usng-assert-equal-fail-when-they-are">rspec - why does this attribute comparison usng assert_equal fail when they are the same, on ubuntu only?</a>  </p>
  </blockquote>
  
  
  
  <pre><code>Ruby: 1.9.3-p194  
  Rails: 3.2.8  
  Ubuntu: 12.04
  </code></pre>
  
  <p>The test has a lot of setup and then eventually does:</p>
  
  <pre><code>assert_equal @iep_service.attributes, IepService.first.attributes
  </code></pre>
  
  <p>Works on a mac but fails on ubuntu with:</p>
  
  <pre><code>  2) Iep Service Spreadsheet A typical district With pre-existing students And a pre-existing Iep Service for one of those students And an Iep S[52/427$
  SV Prevent importing
       Failure/Error: assert_equal @iep_service.attributes, IepService.first.attributes
       MiniTest::Assertion:
         &lt;{"id"=&gt;212,
          "duration"=&gt;30,
          "frequency"=&gt;3,
          "period"=&gt;"week",
          "group_size"=&gt;"group",
          "location"=&gt;nil,
          "service"=&gt;nil,
          "area_of_need"=&gt;"speech",
          "created_at"=&gt;Wed, 24 Oct 2012 18:59:47 UTC +00:00,
          "updated_at"=&gt;Wed, 24 Oct 2012 18:59:47 UTC +00:00,
          "therapist_id"=&gt;nil,
          "start_date"=&gt;nil,
          "end_date"=&gt;nil,
          "student_id"=&gt;233,
          "adhoc"=&gt;false}&gt; expected but was
         &lt;{"id"=&gt;212,
          "duration"=&gt;30,
          "frequency"=&gt;3,
          "period"=&gt;"week",
          "group_size"=&gt;"group",
          "location"=&gt;nil,
          "service"=&gt;nil,
          "area_of_need"=&gt;"speech",
          "created_at"=&gt;Wed, 24 Oct 2012 18:59:47 UTC +00:00,
          "updated_at"=&gt;Wed, 24 Oct 2012 18:59:47 UTC +00:00,
          "therapist_id"=&gt;nil,
          "start_date"=&gt;nil,
          "end_date"=&gt;nil,
          "student_id"=&gt;233,
          "adhoc"=&gt;false}&gt;.
       # (eval):2:in `assert_equal'
       # ./spec/models/iep_service_spreadsheet_spec.rb:71:in `block (6 levels) in &lt;top (required)&gt;'
  </code></pre>
  
  <p>The full source, if it help, is:</p>
  
  <pre><code>context "A typical district" do
    before(:each) { set_up_district }
  
    context "With pre-existing students" do
      before(:each) { StudentSpreadsheet.new(@district, open_spec_fixture_file('sample-students.csv')) }
  
      context "And a pre-existing Iep Service for one of those students" do
        before(:each) { @iep_service = FactoryGirl.create(:iep_service, :student =&gt; @district.students.first) }
  
        context "And an Iep Service CSV" do
          before(:each) { @spreadsheet = IepServiceSpreadsheet.new(@district, open_spec_fixture_file('sample-ieps.c    sv')) }
          specify "Prevent importing" do
            # Leave database untouched
            assert_equal 1, IepService.count
            assert_equal @iep_service.attributes, IepService.first.attributes
  
            # Provide error report
            assert @spreadsheet.error_report.any?
          end
        end
      end
    end
  end
  </code></pre>