Skip to content

Commit

Permalink
Add some extra specs for subject() and described_class()
Browse files Browse the repository at this point in the history
  • Loading branch information
adambeynon committed Nov 1, 2013
1 parent fa4a3c1 commit b0256f1
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 0 deletions.
24 changes: 24 additions & 0 deletions README.md
Expand Up @@ -61,3 +61,27 @@ does not support 2 regexp special characters yet (`\A` and `\z`).

* **line 1**: this is an error in rspec. This autoload does not exist so we must
stub the file.

## License

(The MIT License)

Copyright (C) 2013 by Adam Beynon

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
10 changes: 10 additions & 0 deletions spec/example_spec.rb
Expand Up @@ -90,6 +90,16 @@ def some_helper
it "should create a new instance of subject for classes" do
subject.should == {}
end

it "provides the subject as the described_class" do
expect(described_class).to eq(Hash)
end
end

describe [1, 2, 3] do
it "can use an object instance as a subject" do
expect(subject).to eq([1, 2, 3])
end
end

describe "Simple expectations" do
Expand Down

0 comments on commit b0256f1

Please sign in to comment.