require_relative '../lib/split_and_match_processor' describe SplitAndMatchProcessor do let(:state_mapper) { mock('state_mapper') } subject { SplitAndMatchProcessor.new(state_mapper) } describe "#execute" do it "process raw commit and pass to state mapper" do raw_commit = 'raw_commit' story_commit = mock('story_commit_hash') subject.stub(:process).with(raw_commit).and_return(story_commit) state_mapper.should_receive(:execute).with(story_commit) subject.execute(raw_commit) end end describe "#process" do it "processes raw commit string to a hash { story => commit }" do raw_commit = < '8670b5ee48d9ea26a91b22f6eeee2234098b3a08', '29521391' => '5257d758a95d37441e65d0b5198cbc9dae8cd2cf', '29977427' => '70c9112ddf9f02e6680797f490e418d95a3836ed', '29977409' => '13351e6dfc28e05cc4c13ea039654b95c62185a0' } end it "ignores commit without story id" do raw_commit = < '13351e6dfc28e05cc4c13ea039654b95c62185a0' } end end end