spec/collection_spec.rb in her-0.8.2 vs spec/collection_spec.rb in her-0.8.3

- old
+ new

@@ -1,26 +1,41 @@ -require 'spec_helper' +require "spec_helper" describe Her::Collection do - let(:items) { [1, 2, 3, 4] } - let(:metadata) { { :name => 'Testname' } } - let(:errors) { { :name => ['not_present'] } } + let(:metadata) { { name: "Testname" } } + let(:errors) { { name: ["not_present"] } } describe "#new" do context "without parameters" do subject { Her::Collection.new } - it { should eq([]) } - its(:metadata) { should eq({}) } - its(:errors) { should eq({}) } + it { is_expected.to eq([]) } + + describe "#metadata" do + subject { super().metadata } + it { is_expected.to eq({}) } + end + + describe "#errors" do + subject { super().errors } + it { is_expected.to eq({}) } + end end context "with parameters" do subject { Her::Collection.new(items, metadata, errors) } - it { should eq([1,2,3,4]) } - its(:metadata) { should eq({ :name => 'Testname' }) } - its(:errors) { should eq({ :name => ['not_present'] }) } + it { is_expected.to eq([1, 2, 3, 4]) } + + describe "#metadata" do + subject { super().metadata } + it { is_expected.to eq(name: "Testname") } + end + + describe "#errors" do + subject { super().errors } + it { is_expected.to eq(name: ["not_present"]) } + end end end end