Skip to content

illiad connection#191

Draft
mzelesky wants to merge 2 commits intomainfrom
illiad
Draft

illiad connection#191
mzelesky wants to merge 2 commits intomainfrom
illiad

Conversation

@mzelesky
Copy link
Copy Markdown
Member

Related to #187.

Comment on lines +9 to +12
def initialize
@conn = TinyTds::Client.new({ username: ILLIAD_USER, password: ILLIAD_PASS, host: ILLIAD_HOST,
database: ILLIAD_DB })
end
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One thought occurs to me. If we inject the dependency on TinyTds::Client via the initializer, rather than hardcoding the TinyTds::Client class name within the initialize method, it will probably be simpler to pass in a mock (e.g. described_class.new(tds_client_class: MyFakeTdsClient))

Suggested change
def initialize
@conn = TinyTds::Client.new({ username: ILLIAD_USER, password: ILLIAD_PASS, host: ILLIAD_HOST,
database: ILLIAD_DB })
end
def initialize(tds_client_class: TinyTds::Client)
@conn = tds_client_class.new({ username: ILLIAD_USER, password: ILLIAD_PASS, host: ILLIAD_HOST,
database: ILLIAD_DB })
end

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants