Rails Tutorial (3rd Ed) Integration tests not running because of invalid css selector (c9.io ?) - railstutorial.org

I'm going through the Rails Tutorial (using the cloud9 ide)
(3rd Edition https://www.railstutorial.org/book/)
and I'm running into something odd.
I've just finished chapter 7, and I'm just now noticing that some of my assertions from chapter 5 are not running because "The assertion was not run because of an invalid css selector."
Here's the contents of my test/integration/site_layout_test.rb
require 'test_helper'
class SiteLayoutTest < ActionDispatch::IntegrationTest
test "layout links" do
get root_path
assert_template 'static_pages/home'
assert_select "a[href=?", root_path, count: 2
assert_select "a[href=?", help_path
assert_select "a[href=?", about_path
assert_select "a[href=?", contact_path
assert_select "a[href=?", signup_path
end
end
It seems to be a character for character match to the code found in
https://github.com/mhartl/sample_app_3rd_edition/blob/master/test/integration/site_layout_test.rb
the errors that I'm getting are as follows
DEPRECATION WARNING: The assertion was not run because of an invalid css selector.======= ] 66% Time: 00:00:00, ETA: 00:00:00
unexpected '$' after '[:equal, "\"/\""]' (called from block in <class:SiteLayoutTest> at /home/ubuntu/workspace/sample_app/test/integration/site_layout_test.rb:7)
DEPRECATION WARNING: The assertion was not run because of an invalid css selector.
unexpected '$' after '[:equal, "\"/help\""]' (called from block in <class:SiteLayoutTest> at /home/ubuntu/workspace/sample_app/test/integration/site_layout_test.rb:8)
DEPRECATION WARNING: The assertion was not run because of an invalid css selector.
unexpected '$' after '[:equal, "\"/about\""]' (called from block in <class:SiteLayoutTest> at /home/ubuntu/workspace/sample_app/test/integration/site_layout_test.rb:9)
DEPRECATION WARNING: The assertion was not run because of an invalid css selector.
unexpected '$' after '[:equal, "\"/contact\""]' (called from block in <class:SiteLayoutTest> at /home/ubuntu/workspace/sample_app/test/integration/site_layout_test.rb:10)
DEPRECATION WARNING: The assertion was not run because of an invalid css selector.
unexpected '$' after '[:equal, "\"/signup\""]' (called from block in <class:SiteLayoutTest> at /home/ubuntu/workspace/sample_app/test/integration/site_layout_test.rb:11)
What I find really interesting is that if I delete all of the content from my stylesheets, I still get the same errors.
I have no clue as to where the term "about_path" (or any of the other path symbols) is picking up a $ char.
Am I missing something obvious, I can't find any references when I google the the warning text that has helps me track things back.

You are missing closing square brackets in your a[href] arguments. Your code should be as follows:
require 'test_helper'
class SiteLayoutTest < ActionDispatch::IntegrationTest
test "layout links" do
get root_path
assert_template 'static_pages/home'
assert_select "a[href=?]", root_path, count: 2
assert_select "a[href=?]", help_path
assert_select "a[href=?]", about_path
assert_select "a[href=?]", contact_path
assert_select "a[href=?]", signup_path
end
end

Related

Doxygen "todo:86: warning: Unexpected character

I'm having problems with Doxygen giving me warning messages such as these:
todo:86: warning: Unexpected character `d'
todo:86: warning: Unexpected character `o'
todo:86: warning: Unexpected character `c'
todo:86: warning: Unexpected character `/'
todo:86: warning: Unexpected character `t'
todo:86: warning: Unexpected character `e'
todo:86: warning: Unexpected character `r'
scons: *** [doc/API/html/index.html] Doxygen errors encountered, see doxygen.warn for details
scons: building terminated because of errors.
If I look at doxygen.warn, it just contains the todo:86 lines again, which isn't really details, eh? ;) Anyway, the characters are part of a path in my project, but they don't exist in the sources themselves. I have no idea where the warnings are coming from, and am stuck now, as our team enforces a "no warnings, whatsoever" policy.
Any ideas on where to look for this?

How to use bibliography in different directory when knitting rmarkdown document to beamer presentation?

I'm knitting some beamer slides in an RMarkdown script in Rstudio on a Windows 7 PC. The slides are in the directory
C:/me/slides/myslides.Rmd
I have a master bibliography that lives in
C:/me/bib/masterbib.bib
I cannot figure out how to link to the bibliography file from the RMarkdown document. Here's the YAML from my attempt:
---
title: "Slides"
author: "me"
date: "2016-12-20"
bibliography: C:/me/bib/masterbib.bib
biblio-style: "apalike"
output:
beamer_presentation:
citation_package: natbib
---
Here's the error:
! Undefined control sequence.
<write> \string \bibdata {C:\me\bib\masterbib}
l.174 \end{frame}
Error: Failed to compile Slides.tex. See Slides.log for more info.
In addition: Warning message:
running command '"pdflatex" -halt-on-error -interaction=batchmode "Slides.tex"' had status 1
Execution halted
I've tried a couple other ways to specify the directory for masterbib.bib, but none have worked. I would prefer to keep the masterbib.bib file where it is, and not make an extra copy in the C:/me/slides/ directory. Thanks for your help!
Edit
When attempting to pass the following into YAML (quoteed with forward slashes):
bibliography: "C:/LaTeXstuff/BibTexLibrary/BrianBib.bib"
I get a fatal error with log output:
! Undefined control sequence.
<write> \string \bibdata {C:\me
\bib\masterbib}
l.174 \end{frame}
Here is how much of TeX's memory you used:
18047 strings out of 494045
334241 string characters out of 3145937
424206 words of memory out of 3000000
20891 multiletter control sequences out of 15000+200000
31808 words of font info for 44 fonts, out of 3000000 for 9000
715 hyphenation exceptions out of 8191
56i,11n,55p,434b,376s stack positions out of 5000i,500n,10000p,200000b,50000s
! ==> Fatal error occurred, no output PDF file produced!
When passing the following into YAML (quoted with backslashes)
bibliography: "C:\me\bib\masterbib.bib"
I get the following error in the Rstudio console
Error in yaml::yaml.load(enc2utf8(string), ...) :
Scanner error: while parsing a quoted scalar at line 4, column 15found unknown escape character at line 4, column 29
Calls: <Anonymous> ... yaml_load_utf8 -> mark_utf8 -> <Anonymous> -> .Call
Execution halted
When passing the following into YAML (unquoted with backslashes)
bibliography: C:\me\bib\masterbib.bib
I get the following error in the Rstudio console
! Undefined control sequence.
<write> \string \bibdata {C:\me
\bib\masterbib}
l.174 \end{frame}
Error: Failed to compile BibTest.tex. See BibTest.log for more info.
In addition: Warning message:
running command '"pdflatex" -halt-on-error -interaction=batchmode "BibTest.tex"' had status 1
Execution halted
Try unquoted with two backslashes:
...
bibliography: C:\\me\\bib\\masterbib.bib
...

autoscan Unescaped left brace in regex is deprecated, passed through in regex; marked by <-- HERE in m/\${ <-- HERE [^\}]*}/

when running autoscan 2.69 (2012 release) I got this error message. It is a simple error in the perl code. autoscan is part of autoconf.
I edited the file: /usr/bin/autoscan (only changed line 361) the modified version:
360 s/#.*//;
361 s/\$\{[^\}]*\}//g;
362 s/#[^#]*#//g;
This seems to get rid of the warning (future will be error) message.

repl hangs for ~15 seconds on each error (emacs + cider + boot)

I'm facing a strange behavior whenever I invoke an error in boot-cljs-repl. The repl (actually the entire emacs) hangs for about 15 seconds and after that I see the following error message below the mode-line:
error in process filter: Lisp nesting exceedsmax-lisp-eval-depth'`
An error would e.g be calling (some-nonexisting-function) from the REPL.
Additionally I get an error message inside the REPL itself. Sorry, for posting the whole thing here - I wouldn't know right now which parts are important:
box.webgl> (some-nonexisting-function)
WARNING: Use of undeclared Var box.webgl/some-nonexisting-function at line 1 <cljs repl>
#object[TypeError TypeError: Cannot read property 'call' of undefined]
TypeError: Cannot read property 'call' of undefined
at eval (eval at <anonymous> (http://localhost:3000/main.out/weasel/repl.js:30:470), <anonymous>:1\
:124)
at eval (eval at <anonymous> (http://localhost:3000/main.out/weasel/repl.js:30:470), <anonymous>:9\
:3)
at eval (eval at <anonymous> (http://localhost:3000/main.out/weasel/repl.js:30:470), <anonymous>:1\
4:4)
at http://localhost:3000/main.out/weasel/repl.js:30:465
at http://localhost:3000/main.out/weasel/repl.js:39:4
at cljs.core.MultiFn.call.G__10839__2 (http://localhost:3000/main.out/cljs/core.js:33327:106)
at cljs.core.MultiFn.call.G__10839 [as call] (http://localhost:3000/main.out/cljs/core.js:33594:20\
)
at .<anonymous> (http://localhost:3000/main.out/weasel/repl.js:184:71)
at goog.events.EventTarget.fireListeners (http://localhost:3000/main.out/goog/events/eventtarget.j\
s:284:23)
at Function.goog.events.EventTarget.dispatchEventInternal_ (http://localhost:3000/main.out/goog/ev\
ents/eventtarget.js:381:26)
recently CIDER was changed to automatically supply it's own cider-nrepl and clj-refactor middleware when starting lein, so you can (should) remove these from your ~/.lein/profifiles.clj file if you have them. This will clear up this warning. (remember to update to the latest cider emacs package.
WARNING: CIDER's version (0.12.0-snapshot) does not match
cider-nrepl's version (not installed). Things will break!
This is a problem and hopefully fixing it clears up your other problems. If not, at least solving this is a prerequisite to debugging it properly.

Instruments failing to launch from command line

I have been trying to run Instruments from the command line.
But it fails with the following error:
2012-02-08 14:48:16.104 instruments[94502:60f] -[NSAlert alertWithError:] called
with nil NSError. A generic error message will be displayed,
but the user deserves better.
Wed Feb 8 14:48:16 c1dev-dm23409.overstock.com instruments[94502]
<Error>: kCGErrorInvalidConnection: CGSGetCurrentCursorLocation: Invalid connection
Wed Feb 8 14:48:16 c1dev-dm23409.overstock.com instruments[94502]
<Error>: kCGErrorFailure: Set a breakpoint #CGErrorBreakpoint() to catch errors as
they are logged.
2012-02-08 14:48:16.137 instruments[94502:60f] Recording cancelled : At least
one target failed to launch; aborting run
Can some tell me what I am missing?
I believe the errors Invalid connection and the following Set a breakpoint... are what Instruments responds with when it has any kind of problem.
What's really important is the last line: Recording cancelled : At least one target failed to launch.
In my experience, this either means that your program was unable to load (provisioning profile, nonexistent build, etc) or that you didn't specify it correctly on the command line. Here's how I specify instruments:
$ instruments -t /Developer/Platforms/iPhoneOS.platform/Developer/Library/Instruments/PlugIns/AutomationInstrument.bundle/Contents/Resources/Automation.tracetemplate
/path/to/my/AppName.app -e UIARESULTSPATH . -e UIASCRIPT testscript.js