<commit_before>require 'rspec'
require 'net/http'

require 'railsapp_factory'

describe 'RailsappFactory' do

  before(:all) do
    puts "(DESTROYING ALL)"
    RailsappFactory.cleanup
  end

  describe '::versions' do

    it 'should list some rails versions' do
      list = RailsappFactory.versions
      list.should be_a_kind_of(Array)
      list.should_not be_empty
    end

    it 'should return an empty list for unknown ruby versions' do
      list = RailsappFactory.versions('1.5.0')
      list.should be_a_kind_of(Array)
      list.should be_empty
    end

    # taken from http://www.devalot.com/articles/2012/03/ror-compatibility
    {
        '1.8.6' => %w{2.3 },
        '1.8.7' => %w{2.3 3.0 3.1 3.2},
        '1.9.1' => %w{2.3 },
        '1.9.2' => %w{3.0 3.1 3.2},
        '1.9.3' => %w{3.0 3.1 3.2 4.0},
        '2.0.x' => %w{4.0}
    }.each do |ruby_v, expected|
      it "should list rails versions that are compatible with ruby #{ruby_v}" do<commit_msg>Add debug line to work out why Jruby isn't being listed as having versions<commit_after>require 'rspec'
require 'net/http'

require 'railsapp_factory'

describe 'RailsappFactory' do

  before(:all) do
    puts "(DESTROYING ALL)"
    RailsappFactory.cleanup
  end

  describe '::versions' do

    it 'should list some rails versions' do
      puts "RUBY_VERSION = #{RUBY_VERSION}"
      list = RailsappFactory.versions
      list.should be_a_kind_of(Array)
      list.should_not be_empty
    end

    it 'should return an empty list for unknown ruby versions' do
      list = RailsappFactory.versions('1.5.0')
      list.should be_a_kind_of(Array)
      list.should be_empty
    end

    # taken from http://www.devalot.com/articles/2012/03/ror-compatibility
    {
        '1.8.6' => %w{2.3 },
        '1.8.7' => %w{2.3 3.0 3.1 3.2},
        '1.9.1' => %w{2.3 },
        '1.9.2' => %w{3.0 3.1 3.2},
        '1.9.3' => %w{3.0 3.1 3.2 4.0},
        '2.0.x' => %w{4.0}
    }.each do |ruby_v, expected|
      it "should list rails versions that are compatible with ruby #{ruby_v}" do
{'fraction_non_alphanumeric': 0.1409068746952706, 'fraction_numerical': 0.05265724037055095, 'mean_word_length': 2.442953020134228, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 15, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '335904', 'n_tokens_mistral': 825, 'n_tokens_neox': 764, 'n_words': 195}