Skip to content

Commit

Permalink
Minor rewrite of spec
Browse files Browse the repository at this point in the history
  • Loading branch information
paulfioravanti committed Mar 22, 2017
1 parent b0b6ecc commit f512ca1
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions spec/lib/resume/cli/align_key_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,27 +4,27 @@ module Resume
module CLI
RSpec.describe AlignKey do
describe ".===" do
context "when other has a length more than 1" do
context "when other has a length > 1" do
let(:long_hash) { { align: 1, extra: 2 } }

it "returns false" do
expect(described_class === long_hash).to be false
end
end

context "when other has a length of 1 and has an align key" do
let(:align_key) { { align: 1 } }
context "when other has length == 1 but key != :align" do
let(:non_align_key) { { something_else: 1 } }

it "returns true" do
expect(described_class === align_key).to be true
it "returns false" do
expect(described_class === non_align_key).to be false
end
end

context "when other does not have an align key" do
let(:non_align_key) { { something_else: 1 } }
context "when other has length == 1 and key == :align" do
let(:align_key) { { align: 1 } }

it "returns false" do
expect(described_class === non_align_key).to be false
it "returns true" do
expect(described_class === align_key).to be true
end
end
end
Expand Down

0 comments on commit f512ca1

Please sign in to comment.