<commit_before>require 'spec_helper'
require 'dotify/version_checker'

module Dotify
  describe VersionChecker do
    it "#run_check! should return the right version number" do
      VCR.use_cassette "version_check" do
        VersionChecker.version.should == '0.2.0'
      end
    end
    describe VersionChecker, "#out_of_date?" do
      it "should be return the correct value if version is not current" do
        VersionChecker.stub(:current?).and_return(false)
        VersionChecker.out_of_date?.should == true
        VersionChecker.stub(:current?).and_return(true)
        VersionChecker.out_of_date?.should == false
      end
    end
    describe VersionChecker, "#current?" do
      it "should be false if version is not current" do
        with_constants "Dotify::VERSION" => '0.2.0' do
          VersionChecker.stub(:version).and_return('0.1.9')
          VersionChecker.current?.should == false
        end
      end
      it "should be true if version is current" do
        with_constants "Dotify::VERSION" => '0.2.0' do
          VersionChecker.stub(:version).and_return('0.2.0')
          VersionChecker.current?.should == true
        end
      end
    end
  end
end
<commit_msg>RSpec 2.11's stub_const for constant stubbing<commit_after>require 'spec_helper'
require 'dotify/version_checker'

module Dotify
  describe VersionChecker do
    it "#run_check! should return the right version number" do
      VCR.use_cassette "version_check" do
        VersionChecker.version.should == '0.2.0'
      end
    end
    describe VersionChecker, "#out_of_date?" do
      it "should be return the correct value if version is not current" do
        VersionChecker.stub(:current?).and_return(false)
        VersionChecker.out_of_date?.should == true
        VersionChecker.stub(:current?).and_return(true)
        VersionChecker.out_of_date?.should == false
      end
    end
    describe VersionChecker, "#current?" do
      it "should be false if version is not current" do
        stub_const "Dotify::VERSION", '0.2.0'
          VersionChecker.stub(:version).and_return('0.1.9')
        VersionChecker.current?.should == false
    end
      it "should be true if version is current" do
        stub_const "Dotify::VERSION", '0.2.0'
        VersionChecker.stub(:version).and_return('0.2.0')
        VersionChecker.current?.should == true
      end
    end
  end
end

{'fraction_non_alphanumeric': 0.09848484848484848, 'fraction_numerical': 0.013888888888888888, 'mean_word_length': 2.852512155591572, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '3728724', 'n_tokens_mistral': 694, 'n_tokens_neox': 720, 'n_words': 189}