<commit_before>Strategy = MotionBindable::Strategy

class ObjectOne; attr_accessor :attribute end
class ObjectTwo; attr_accessor :attribute end

class FakeStrategyOne < Strategy; end
class FakeStrategyTwo < Strategy; end

describe 'MotionBindable::Strategy' do

  before do
    Strategy.register_strategy(FakeStrategyOne, ObjectOne)
    Strategy.register_strategy(FakeStrategyTwo, ObjectTwo)
  end

  describe 'class methods' do

    describe 'self#find_by_reference' do

      it 'returns a strategy that specifies the object as a candidate' do
        Strategy.find_by_reference(ObjectOne.new).should.equal FakeStrategyOne
        Strategy.find_by_reference(ObjectTwo.new).should.equal FakeStrategyTwo
      end

    end

  end

  describe 'instance methods' do

    before do
      @object = ObjectOne.new
      @bound = Object.new
      @strategy = Strategy.new(@object, :attribute)
      @strategy.stub!(:watch_bound)
      @strategy.stub!(:watch_object)
    end<commit_msg>Fix up strategy spec.<commit_after>Strategy = MotionBindable::Strategy

class ObjectOne; attr_accessor :attribute end
class ObjectTwo; attr_accessor :attribute end

class FakeStrategyOne < Strategy; end
class FakeStrategyTwo < Strategy; end

describe 'MotionBindable::Strategy' do

  before do
    Strategy.register_strategy(FakeStrategyOne, ObjectOne)
    Strategy.register_strategy(FakeStrategyTwo, ObjectTwo)
  end

  describe 'class methods' do

    describe 'self#find_by_reference' do

      it 'returns a strategy that specifies the object as a candidate' do
        Strategy.find_by_reference(ObjectOne.new).should.equal FakeStrategyOne
        Strategy.find_by_reference(ObjectTwo.new).should.equal FakeStrategyTwo
      end

    end

  end

  describe 'instance methods' do

    before do
      @object = ObjectOne.new
      @bound = Object.new
      @strategy = Strategy.new(@object, :attribute)
      @strategy.stub!(:watch)
    end
{'fraction_non_alphanumeric': 0.07332293291731669, 'fraction_numerical': 0.0, 'mean_word_length': 3.9715762273901807, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 3, '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': '4418589', 'n_tokens_mistral': 575, 'n_tokens_neox': 539, 'n_words': 145}