Sha256: dcc61b3e2c5951dfc2b0098056034c0871d3f09b9e45e0e2531c920bc378412f
Contents?: true
Size: 708 Bytes
Versions: 142
Compression:
Stored size: 708 Bytes
Contents
require "spec_helper" describe FactoryGirl::NullObject do let(:methods_to_respond_to) { %w[id age name admin?] } let(:methods_to_not_respond_to) { %w[email date_of_birth title] } subject { FactoryGirl::NullObject.new(methods_to_respond_to) } it "responds to the given methods" do methods_to_respond_to.each do |method_name| subject.__send__(method_name).should be_nil subject.respond_to?(method_name).should be_true end end it "does not respond to other methods" do methods_to_not_respond_to.each do |method_name| expect { subject.__send__(method_name) }.to raise_error(NoMethodError) subject.respond_to?(method_name).should be_false end end end
Version data entries
142 entries across 82 versions & 6 rubygems