Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

add feature for attribute of subject

  • Loading branch information...
commit 2243b40598c8bc3554cb351d4d6d53f6e72a9fa1 1 parent 62aac0c
@dchelimsky dchelimsky authored
Showing with 19 additions and 0 deletions.
  1. +19 −0 features/expectations/attribute_of_subject.feature
View
19 features/expectations/attribute_of_subject.feature
@@ -0,0 +1,19 @@
+Feature: attribute of subject
+
+ In order to get more meaningful failure messages
+ As a spec author
+ I want RSpec to tell me what attribute a matcher applies
+ to when using the its(:attribute) technique
+
+ Scenario: eq matcher fails
+ Given a file named "example_spec.rb" with:
+ """
+ describe "an array" do
+ subject { [] }
+ its(:size) { should eq(1) } # intentionally fail
+ end
+ """
+
+ When I run "rspec example_spec.rb -fdoc"
+ Then I should see "Failure/Error: its(:size) { should eq(1) }"
+ And I should see "expected 1"
Please sign in to comment.
Something went wrong with that request. Please try again.