<commit_before>require "micro-optparse"

describe Parser do
  it "should return 1" do
    1.should == 1
  end
end<commit_msg>add tests for help message, version and default values<commit_after>require "micro-optparse"

describe Parser do
  describe "example program" do
    it "should show help message when called with --help or -h" do
      results = [`ruby spec/programs/example.rb -h`, `ruby spec/programs/example.rb --help`]
      results.each do |result|
        result.should include("--help")
        result.should include("Show this message")
      end
    end

    it "should include the banner info in the help message" do
      result = `ruby spec/programs/example.rb --help`
      result.should include("This is a banner")
    end
    
    it "should display the version when called with --version or -V" do
      # here -V is used for version, as -v is already taken for the verbose switch
      results = [`ruby spec/programs/example.rb -V`, `ruby spec/programs/example.rb --version`]
      results.each do |result|
        result.strip.should == "OptParseWrapper 0.8 (c) <NAME> 2011"
      end
    end
    
    it "should display the default values if called without arguments" do
      result = `ruby spec/programs/example.rb`
      result.should include(":severity => 4")
      result.should include(":verbose => false")
      result.should include(":plus_selection => true")
      result.should include(":selection => BestSelection")
      result.should include(":chance => 0.8")
    end
  end
end
{'fraction_non_alphanumeric': 0.10620052770448549, 'fraction_numerical': 0.0079155672823219, 'mean_word_length': 2.850253807106599, 'pattern_counts': {'":': 5, '<': 4, '<?xml version=': 0, '>': 9, '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': '2599020', 'n_tokens_mistral': 454, 'n_tokens_neox': 429, 'n_words': 158}