From 1bdd46aecd7f7e06f6ecaa2c7e7e3b97ae044250 Mon Sep 17 00:00:00 2001 From: Chuck Callebs Date: Fri, 27 May 2016 18:32:28 -0400 Subject: [PATCH] Add GitLeft::KeyParser specs. --- spec/lib/key_parser_spec.rb | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 spec/lib/key_parser_spec.rb diff --git a/spec/lib/key_parser_spec.rb b/spec/lib/key_parser_spec.rb new file mode 100644 index 0000000..1a9d751 --- /dev/null +++ b/spec/lib/key_parser_spec.rb @@ -0,0 +1,25 @@ +require 'spec_helper' + +describe GitLeft::KeyParser do + describe '#action' do + subject { described_class.new(input).action } + + context 'with h input' do + let(:input) { 'h' } + + it { is_expected.to eq(:delete) } + end + + context 'with l input' do + let(:input) { 'l' } + + it { is_expected.to eq(:skip) } + end + + context 'with anything else' do + let(:input) { 'o' } + + it { is_expected.to eq(:quit) } + end + end +end