Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
the first fact using provided suceeds, but the second using against-background fails
(ns ybot.shaper-tests
(:use cascalog.api
ybot.analytics.yb.shaper
[ybot datastores]
[midje sweet cascalog]))
(let [tag-data [["jmblog"
"07409273223006096"
"http://www.optimizeandprophesize.com/jonathan_mendezs_blog/2007/02/optimize_your_y.html"
"United States"
"California"
"Manhattan Beach"
"http://www.google.com/url?sa=t&rct=j&q=best%20way%20to%20tag%20youtube%20videos&source=web&cd=1&sqi=2&ved=0CBwQFjAA&url=http%3A%2F%2Fwww.optimizeandprophesize.com%2Fjonathan_mendezs_blog%2F2007%2F02%2Foptimize_your_y.html&ei=Xu-DTuG4NcXmiAKKufnSDA&usg=AFQjCNE-_Q4oLjp8UxrUZyXgsMKiFly4kQ&sig2=7_J-WQtnbS_oR5oPQEQ5fA&cad=rja"
"1"
"true"]
["jmblog"
"07409273223006097"
"http://www.optimizeandprophesize.com/jonathan_mendezs_blog/"
"United States"
"California"
"Manhattan Beach"
"http://www.google.com/url?sa=t&rct=j&q=best%20way%20to%20tag%20youtube%20videos&source=web&cd=1&sqi=2&ved=0CBwQFjAA&url=http%3A%2F%2Fwww.optimizeandprophesize.com%2Fjonathan_mendezs_blog%2F2007%2F02%2Foptimize_your_y.html&ei=Xu-DTuG4NcXmiAKKufnSDA&usg=AFQjCNE-_Q4oLjp8UxrUZyXgsMKiFly4kQ&sig2=7_J-WQtnbS_oR5oPQEQ5fA&cad=rja"
"0"
"true"]]]
(fact?-
[["jmblog"
"United States"
"California"
"Manhattan Beach"
"best way to tag youtube videos"
"www.google.com"
"http://www.optimizeandprophesize.com/jonathan_mendezs_blog/2007/02/optimize_your_y.html"
1]]
(new-visits :root)
(provided
(select-fields (ybtag-tap :root) ["!psn" "!pvi" "!lo" "!g_C" "!g_r" "!g_c" "!r" "!nv" "!ln"]) =>
[["jmblog"
"07409273223006096"
"http://www.optimizeandprophesize.com/jonathan_mendezs_blog/2007/02/optimize_your_y.html"
"United States"
"California"
"Manhattan Beach"
"http://www.google.com/url?sa=t&rct=j&q=best%20way%20to%20tag%20youtube%20videos&source=web&cd=1&sqi=2&ved=0CBwQFjAA&url=http%3A%2F%2Fwww.optimizeandprophesize.com%2Fjonathan_mendezs_blog%2F2007%2F02%2Foptimize_your_y.html&ei=Xu-DTuG4NcXmiAKKufnSDA&usg=AFQjCNE-_Q4oLjp8UxrUZyXgsMKiFly4kQ&sig2=7_J-WQtnbS_oR5oPQEQ5fA&cad=rja"
"1"
"true"]
["jmblog"
"07409273223006097"
"http://www.optimizeandprophesize.com/jonathan_mendezs_blog/"
"United States"
"California"
"Manhattan Beach"
"http://www.google.com/url?sa=t&rct=j&q=best%20way%20to%20tag%20youtube%20videos&source=web&cd=1&sqi=2&ved=0CBwQFjAA&url=http%3A%2F%2Fwww.optimizeandprophesize.com%2Fjonathan_mendezs_blog%2F2007%2F02%2Foptimize_your_y.html&ei=Xu-DTuG4NcXmiAKKufnSDA&usg=AFQjCNE-_Q4oLjp8UxrUZyXgsMKiFly4kQ&sig2=7_J-WQtnbS_oR5oPQEQ5fA&cad=rja"
"0"
"true"]])
[["jmblog"
"United States"
"California"
"Manhattan Beach"
"best way to tag youtube videos"
"www.google.com"
"http://www.optimizeandprophesize.com/jonathan_mendezs_blog/"
1]]
(return-visits :root)
(against-background
(ybtag-tap :root) => :tmp
(select-fields :tmp ["!psn" "!pvi" "!lo" "!g_C" "!g_r" "!g_c" "!r" "!nv" "!ln"]) =>
tag-data)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.