Skip to content

Commit 3e7b1e3

Browse files
committed
Dry up tests with common enumerable behaviour.
1 parent 5d3ff79 commit 3e7b1e3

2 files changed

Lines changed: 16 additions & 1 deletion

File tree

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# encoding: utf-8
2+
3+
shared_examples_for 'an array of resources' do
4+
5+
it "should return array of resources" do
6+
objects = requestable
7+
objects.should be_an Array
8+
objects.should have(1).items
9+
end
10+
11+
it "should be a mash type" do
12+
objects = requestable
13+
objects.first.should be_a Hashie::Mash
14+
end
15+
end

spec/spec_helper.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717
# Requires supporting files with custom matchers and macros, etc,
1818
# in ./support/ and its subdirectories.
19-
Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each {|f| require f}
19+
Dir["#{File.dirname(__FILE__)}/{support,shared}/**/*.rb"].each { |f| require f }
2020

2121
module Github
2222
def reset!

0 commit comments

Comments
 (0)