Skip to content

Commit ced0c8e

Browse files
committed
Add settings parametrs to feature steps.
1 parent 3941aa9 commit ced0c8e

1 file changed

Lines changed: 14 additions & 2 deletions

File tree

features/step_definitions/github_api_steps.rb

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,21 @@
11
Given /^I have github instance$/ do
2-
@github = Github.new
2+
@github = Github.new(
3+
:basic_auth => SETTINGS['basic_auth'],
4+
:oauth_token => SETTINGS['oauth_token']
5+
)
36
end
47

58
Given /^I have "([^"]*)" instance$/ do |api_classes|
6-
@instance = convert_to_constant(api_classes).new
9+
@instance = convert_to_constant(api_classes).new(
10+
:basic_auth => SETTINGS['basic_auth'],
11+
:oauth_token => SETTINGS['oauth_token']
12+
)
13+
end
14+
15+
When /^I am not authorized$/ do
16+
[:basic_auth, :login, :password, :oauth_token].each do |attr|
17+
@instance.send("#{attr}=", nil)
18+
end
719
end
820

921
When /^I fetch "([^"]*)"$/ do |method|

0 commit comments

Comments
 (0)