<commit_before>require File.expand_path(File.dirname(__FILE__) + '/../spec_helper')

describe Twat do

  it "Should bail if finger is called without an argument" do #{{{
    with_config(Fixtures::multiuser_config) do
      set_argv ["finger"]
      STDOUT.expects(:puts).with(Twat::Subcommands::Finger.usage)

      lambda { Twat::Twat.new.cli_run }.should raise_error SystemExit
    end
  end #}}}

  it "Should retrieve a tweet for user if called with only a user" do #{{{
    with_config(Fixtures::multiuser_config) do
      tweet = mock()
      tweet.expects(:each).yields(tweet)
      Twitter.expects(:user_timeline).with("hanke", :count => 1).returns(tweet)
      Twat::Subcommands::Finger.any_instance.expects(:format).with(tweet)

      set_argv ["finger", "hanke"]

      Twat::Twat.new.cli_run
    end
  end #}}}

  it "Should retrieve n tweets for user if invoked with count" do #{{{
    with_config(Fixtures::multiuser_config) do
      tweet = mock()
      Twitter.expects(:user_timeline).with("hanke", :count => 3).returns([tweet, tweet, tweet])
      Twat::Subcommands::Finger.any_instance.expects(:format).with(tweet).times(3)

      set_argv ["finger", "hanke", "3"]

      Twat::Twat.new.cli_run
    end
  end #}}}

end<commit_msg>Fix broken output in test suite<commit_after>require File.expand_path(File.dirname(__FILE__) + '/../spec_helper')

describe Twat do

  it "Should bail if finger is called without an argument" do #{{{
    with_config(Fixtures::multiuser_config) do
      set_argv ["finger"]
      STDOUT.expects(:puts).with(Twat::Subcommands::Finger.usage)

      lambda { Twat::Twat.new.cli_run }.should raise_error SystemExit
    end
  end #}}}

  it "Should retrieve a tweet for user if called with only a user" do #{{{
    with_config(Fixtures::multiuser_config) do
      tweet = mock()
      tweet.expects(:each).yields(tweet)
      Twitter.expects(:user_timeline).with("hanke", :count => 1).returns(tweet)
      Twat::Subcommands::Finger.any_instance.expects(:format).with(tweet)

      set_argv ["finger", "hanke"]

      STDOUT.expects(:puts)
      Twat::Twat.new.cli_run
    end
  end #}}}

  it "Should retrieve n tweets for user if invoked with count" do #{{{
    with_config(Fixtures::multiuser_config) do
      tweet = mock()
      Twitter.expects(:user_timeline).with("hanke", :count => 3).returns([tweet, tweet, tweet])
      Twat::Subcommands::Finger.any_instance.expects(:format).with(tweet).times(3)

      set_argv ["finger", "hanke", "3"]

      STDOUT.expects(:puts).times(3)
      Twat::Twat.new.cli_run
    end
  end #}}}

end
{'fraction_non_alphanumeric': 0.14540519581233036, 'fraction_numerical': 0.0034897246994959287, 'mean_word_length': 3.751381215469613, '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': '3722516', 'n_tokens_mistral': 902, 'n_tokens_neox': 865, 'n_words': 182}