Module: CapybaraSfdc

Defined in:
lib/capybara_sfdc/rspec.rb,
lib/capybara_sfdc/config.rb,
lib/capybara_sfdc/version.rb

Defined Under Namespace

Modules: RSpec Classes: Configuration

Constant Summary collapse

VERSION =
"0.0.1"

Class Method Summary collapse

Class Method Details

.clientObject

Retrieve the databasedotcom client



12
13
14
# File 'lib/capybara_sfdc/config.rb', line 12

def client
  @client
end

.configurationObject



7
8
9
# File 'lib/capybara_sfdc/config.rb', line 7

def configuration
  @configuration ||= Configuration.new
end

.configure {|configuration| ... } ⇒ Object

Pass in a block to configure

Yields:



17
18
19
20
21
22
23
24
25
26
27
# File 'lib/capybara_sfdc/config.rb', line 17

def configure
  yield configuration
  client = Databasedotcom::Client.new :client_id => configuration.client_id, :client_secret => configuration.client_secret, :host => configuration.host
  client.authenticate :username => configuration.username, :password => "#{CGI::escape(configuration.password)}#{configuration.security_token}"
  ::RSpec.configure do |config|
    config.before(:each) { client.cleanup }
    config.after(:each)  { client.cleanup }
    config.include ::CapybaraSfdc::RSpec::Helpers
  end if configuration.rspec
  @client = client
end