Sha256: 1e0067e747e56f65673cf2d6a1e44b3bacf8345dc6e7aa6f5b4e20f89b45ccc5
Contents?: true
Size: 785 Bytes
Versions: 21
Compression:
Stored size: 785 Bytes
Contents
shared_examples_for :it_has_a_dependency_accessor do |accessor_name| describe accessor_name.to_s do it "returns the #{accessor_name} object as assigned" do subject.send("#{accessor_name}=", :thing) subject.send(accessor_name).should == :thing end context "when the #{accessor_name} object is not set" do it 'raises a StandardError' do lambda { subject.send(accessor_name) } \ .should raise_error(StandardError) end it "explains that the #{accessor_name} was not set on initialiation" do begin subject.send(accessor_name) rescue StandardError => e e.message.should == "No #{accessor_name} object was set on #{subject.class.name} initialization." end end end end end
Version data entries
21 entries across 21 versions & 1 rubygems