Skip to content

Commit

Permalink
Add test for failing method_missing
Browse files Browse the repository at this point in the history
  • Loading branch information
ericgriffis committed Mar 7, 2017
1 parent 2feefce commit 108e40e
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions spec/lib/acts_as_citable/base_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,11 @@
it { is_expected.to respond_to :to_chicago_author_date }
it { is_expected.to_not respond_to :to_random }
end
describe "method_missing" do
it "should raise an error for undefined method" do
expect{ record.to_random }.to raise_error NoMethodError
end
end

describe "self.format_field" do
subject{ model_class.format_field }
Expand Down Expand Up @@ -133,6 +138,11 @@
it { is_expected.to respond_to :to_chicago_author_date }
it { is_expected.to_not respond_to :to_random }
end
describe "method_missing" do
it "should raise an error for undefined method" do
expect{ record.to_random }.to raise_error NoMethodError
end
end

describe "self.format_field" do
subject{ model_class.format_field }
Expand Down

0 comments on commit 108e40e

Please sign in to comment.