Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

adds tests and read ttl functionality #11

Merged
merged 3 commits into from
Dec 5, 2016
Merged

Conversation

zackattack01
Copy link
Contributor

@zackattack01 zackattack01 commented Dec 2, 2016

Allows us to read the TTL off of a cell by passing in the table_name, target column, and key value pairs for the where query

Copy link

@dattocgernon dattocgernon left a comment

Choose a reason for hiding this comment

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

One suggestion, one question

@client.insert(:test, item)

resulting_ttl = @client.select_ttl(:test, :d, {:id => 'i'})
assert (1..ttl).include? resulting_ttl

Choose a reason for hiding this comment

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

Why the include? in this test instead of just an assert_equal ttl, resulting_ttl?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

depending on how long the query takes to execute the TTL could be less than it originally was

Choose a reason for hiding this comment

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

ah, now I get it

@@ -161,6 +161,25 @@ def string_keys(hash)
end
end

context 'select_ttl' do

Choose a reason for hiding this comment

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

Would be good to see one more test with two where_arguments (one integer and one string) just to fully exercise that select_ttl_statement method ...

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yeah good idea i can do that

Copy link

@dattocgernon dattocgernon left a comment

Choose a reason for hiding this comment

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

👾

@zackattack01 zackattack01 merged commit 6098e64 into master Dec 5, 2016
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.

3 participants