spec/facemock/database/tables_spec.rb in facemock-0.0.5 vs spec/facemock/database/tables_spec.rb in facemock-0.0.6

- old
+ new

@@ -449,10 +449,15 @@ subject { lambda { Facemock::Database::Table.find_by_id } } it { is_expected.to raise_error ArgumentError } end describe '.find_by_id' do + context 'with nil' do + subject { Facemock::Database::Table.find_by_id(nil) } + it { is_expected.to be_nil } + end + context 'with not id' do subject { Facemock::Database::Table.find_by_id("hoge") } it { is_expected.to be_nil } end @@ -510,9 +515,14 @@ subject { lambda { Facemock::Database::Table.find_all_by_id } } it { is_expected.to raise_error ArgumentError } end describe '.find_all_by_id' do + context 'with nil' do + subject { Facemock::Database::Table.find_all_by_id(nil) } + it { is_expected.to be_empty } + end + context 'with not id' do subject { Facemock::Database::Table.find_all_by_id("hoge") } it { is_expected.to be_empty } end