Sha256: 21eaa4a564931482c13f7ccdab97d03b99b0c7f53c21374f4c46c4d937489abe
Contents?: true
Size: 1.06 KB
Versions: 154
Compression:
Stored size: 1.06 KB
Contents
require 'spec_helper' require 'semantic/dependency/unsatisfiable_graph' describe Semantic::Dependency::UnsatisfiableGraph do let(:modules) { %w[ foo bar baz ] } let(:graph) { double('Graph', :modules => modules) } let(:instance) { described_class.new(graph) } subject { instance } describe '#message' do subject { instance.message } it { should match /#{instance.send(:sentence_from_list, modules)}/ } end describe '#sentence_from_list' do subject { instance.send(:sentence_from_list, modules) } context 'with a list of one item' do let(:modules) { %w[ foo ] } it { should eql 'foo' } end context 'with a list of two items' do let(:modules) { %w[ foo bar ] } it { should eql 'foo and bar' } end context 'with a list of three items' do let(:modules) { %w[ foo bar baz ] } it { should eql 'foo, bar, and baz' } end context 'with a list of more than three items' do let(:modules) { %w[ foo bar baz quux ] } it { should eql 'foo, bar, baz, and quux' } end end end
Version data entries
154 entries across 154 versions & 2 rubygems