-
-
Notifications
You must be signed in to change notification settings - Fork 411
/
helper.rb
55 lines (43 loc) · 1.03 KB
/
helper.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
unless ENV['CI']
require 'simplecov'
SimpleCov.start do
add_filter 'spec'
end
end
require 't'
require 'rspec'
require 'timecop'
require 'webmock/rspec'
def a_delete(path, endpoint=Twitter.endpoint)
a_request(:delete, endpoint + path)
end
def a_get(path, endpoint=Twitter.endpoint)
a_request(:get, endpoint + path)
end
def a_post(path, endpoint=Twitter.endpoint)
a_request(:post, endpoint + path)
end
def a_put(path, endpoint=Twitter.endpoint)
a_request(:put, endpoint + path)
end
def stub_delete(path, endpoint=Twitter.endpoint)
stub_request(:delete, endpoint + path)
end
def stub_get(path, endpoint=Twitter.endpoint)
stub_request(:get, endpoint + path)
end
def stub_post(path, endpoint=Twitter.endpoint)
stub_request(:post, endpoint + path)
end
def stub_put(path, endpoint=Twitter.endpoint)
stub_request(:put, endpoint + path)
end
def project_path
File.expand_path("../..", __FILE__)
end
def fixture_path
File.expand_path("../fixtures", __FILE__)
end
def fixture(file)
File.new(fixture_path + '/' + file)
end