Created
July 13, 2012 05:00
-
-
Save diabolo/3102828 to your computer and use it in GitHub Desktop.
Don't use variables in step_defs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'rubygems' | |
require 'mechanize' | |
require 'json' | |
module ApiExtensions | |
@agent = Mechanize.new | |
@api_header = {'Accept' => 'application/json', 'Content-Type' => 'application/json'} | |
@api_uris = { | |
'the list of campuses' => 'http://example.com/servicehosts/campus.svc', | |
'the list of settings' => 'http://example.com/servicehosts/setting.svc', | |
'login' => 'http://example.com/servicehosts/Student.svc/login', | |
} | |
# some methods | |
end | |
World(ApiExtensions) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'rubygems' | |
require 'mechanize' | |
require 'json' | |
module ApiExtensions | |
def mechanize_agent | |
Mechanize.new | |
end | |
def api_json_header | |
{'Accept' => 'application/json', 'Content-Type' => 'application/json'} | |
end | |
def api_uris | |
{ | |
'the list of campuses' => 'http://example.com/servicehosts/campus.svc', | |
'the list of settings' => 'http://example.com/servicehosts/setting.svc', | |
'login' => 'http://example.com/servicehosts/Student.svc/login', | |
} | |
end | |
# some methods | |
end | |
World(ApiExtensions) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment