Sha256: ee2afd4c7bb011c4e4ff549614488005f66af747b37c43524c569a50ef21f447

Contents?: true

Size: 1.25 KB

Versions: 19

Compression:

Stored size: 1.25 KB

Contents

require File.expand_path(File.join(File.dirname(__FILE__), 'test_helper'))

class LegacyFixtureModeTest < Test::Unit::TestCase
  def setup
    create_and_blow_away_old_db
    force_fixture_generation
  end

  def teardown
    FixtureBuilder.send(:remove_instance_variable, :@configuration)
  end

  def test_load_legacy_fixtures
    FixtureBuilder.configure do |fbuilder|
      fbuilder.legacy_fixtures = Dir[test_path("legacy_fixtures/*.yml"), test_path("other_legacy_fixture_set/*.yml")] 
      fbuilder.factory do
      end
    end
    assert_equal 3, MagicalCreature.all.size
  end

  def test_generate_new_fixtures_without_legacy
    FixtureBuilder.configure do |fbuilder|
      fbuilder.files_to_check += Dir[test_path("*.rb")]
      fbuilder.factory do
        MagicalCreature.create :name => "Melinda", :species => "Philanthropist"
      end
    end
    assert_equal 1, MagicalCreature.all.size
  end

  def test_new_and_old_fixtures
    FixtureBuilder.configure do |fbuilder|
      fbuilder.legacy_fixtures = Dir[test_path("legacy_fixtures/*.yml"), test_path("other_legacy_fixture_set/*.yml")] 
      fbuilder.factory do
        MagicalCreature.create :name => "Barry", :species => "Party Guy"
      end
    end
    assert_equal 4, MagicalCreature.all.size
  end
end

Version data entries

19 entries across 19 versions & 1 rubygems

Version Path
fixture_builder-0.5.3.rc2 test/legacy_fixture_mode_test.rb
fixture_builder-0.5.3.rc1 test/legacy_fixture_mode_test.rb
fixture_builder-0.5.2 test/legacy_fixture_mode_test.rb
fixture_builder-0.5.2.rc3 test/legacy_fixture_mode_test.rb
fixture_builder-0.5.2.rc2 test/legacy_fixture_mode_test.rb
fixture_builder-0.5.2.rc1 test/legacy_fixture_mode_test.rb
fixture_builder-0.5.1 test/legacy_fixture_mode_test.rb
fixture_builder-0.5.1.rc4 test/legacy_fixture_mode_test.rb
fixture_builder-0.5.0 test/legacy_fixture_mode_test.rb
fixture_builder-0.5.0.pre.RC1 test/legacy_fixture_mode_test.rb
fixture_builder-0.4.1 test/legacy_fixture_mode_test.rb
fixture_builder-0.4.0 test/legacy_fixture_mode_test.rb
fixture_builder-0.3.6 test/legacy_fixture_mode_test.rb
fixture_builder-0.3.5 test/legacy_fixture_mode_test.rb
fixture_builder-0.3.4 test/legacy_fixture_mode_test.rb
fixture_builder-0.3.3 test/legacy_fixture_mode_test.rb
fixture_builder-0.3.2 test/legacy_fixture_mode_test.rb
fixture_builder-0.3.1 test/legacy_fixture_mode_test.rb
fixture_builder-0.3.0 test/legacy_fixture_mode_test.rb