<commit_before>dir = File.dirname(__FILE__)
require File.expand_path("#{dir}/../helper/spec_helper")

describe "a GemListChecker instance" do
  before(:each) do
    GemInstaller::TestGemHome.use
    
    @registry = GemInstaller.create_registry
    @gem_list_checker = @registry.gem_list_checker
    @sample_gem = sample_gem
  end

  it "should properly specify default platform if platform is unspecified" do
    @sample_gem.platform = nil
    should_not_raise_error    
  end

  it "should properly specify highest version if version is unspecified" do
    @sample_gem.version = GemInstaller::RubyGem.default_version
    should_not_raise_error    
  end

  it "should properly specify with a binary platform" do
    @sample_gem.name = "stubgem-multiplatform"
    @sample_gem.version = "1.0.1"
    @sample_gem.platform = Gem::Platform::WIN32
    should_not_raise_error    
  end

  it "should properly specify with a ruby platform even though binary platforms exist" do
    @sample_gem.name = "stubgem-multiplatform"
    @sample_gem.platform = "ruby"
    should_not_raise_error    
  end

  it "should properly specify with a non-exact version" do
    @sample_gem.name = "stubgem-multiplatform"
    @sample_gem.version = "> 0.0.0"
    @sample_gem.platform = "ruby"
    should_not_raise_error<commit_msg>fix platform handling for binary gem test for rubygems >=0.9.5<commit_after>dir = File.dirname(__FILE__)
require File.expand_path("#{dir}/../helper/spec_helper")

describe "a GemListChecker instance" do
  before(:each) do
    GemInstaller::TestGemHome.use
    
    @registry = GemInstaller.create_registry
    @gem_list_checker = @registry.gem_list_checker
    @sample_gem = sample_gem
  end

  it "should properly specify default platform if platform is unspecified" do
    @sample_gem.platform = nil
    should_not_raise_error    
  end

  it "should properly specify highest version if version is unspecified" do
    @sample_gem.version = GemInstaller::RubyGem.default_version
    should_not_raise_error    
  end

  it "should properly specify with a binary platform" do
    @sample_gem.name = "stubgem-multiplatform"
    @sample_gem.version = "1.0.1"
    if RUBYGEMS_VERSION_CHECKER.matches?('>=0.9.5')
      @sample_gem.platform = Gem::Platform.new('mswin32')
    else
      @sample_gem.platform = Gem::Platform::WIN32
    end
    should_not_raise_error    
  end

  it "should properly specify with a ruby platform even though binary platforms exist" do
    @sample_gem.name = "stubgem-multiplatform"
    @sample_gem.platform = "ruby"
    should_not_raise_error    
  end

  it "should properly specify with a non-exact version" do
    @sample_gem.name = "stubgem-multiplatform"
    @sample_gem.version = "> 0.0.0"
    @sample_gem.platform = "ruby"
    should_not_raise_error
{'fraction_non_alphanumeric': 0.08542713567839195, 'fraction_numerical': 0.008614501076812634, 'mean_word_length': 3.7722602739726026, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, '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': '2387989', 'n_tokens_mistral': 897, 'n_tokens_neox': 873, 'n_words': 218}