{"issue":{"pull_request":{"diff_url":null,"html_url":null,"patch_url":null},"state":"open","user":{"avatar_url":"https://secure.gravatar.com/avatar/ead0c810163c355535e7c47c20955073?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","gravatar_id":"ead0c810163c355535e7c47c20955073","url":"https://api.github.com/users/mungruby","login":"mungruby","id":1103706},"milestone":null,"assignee":null,"updated_at":"2011-10-28T18:41:20Z","labels":[],"comments":0,"closed_at":null,"url":"https://api.github.com/repos/UWE-Ruby/week-04/issues/1","body":": url_builder_spec.rb\r\n\r\nThere were a number of different ways I could get the tests to pass, but the simplest was as follows:\r\n\r\n  # let(:url) {'http://google.com'}\r\n  def url\r\n    \"http://google.com\"\r\n  end\r\n\r\nElse I would get:\r\n\r\n\r\nC:\\projects\\ruby\\cp110a\\week-04>rspec spec/url_builder_spec.rb\r\nF.FFF\r\n\r\nFailures:\r\n\r\n  1) #url_builder should fail\r\n     Failure/Error: fail\r\n     RuntimeError:\r\n     # ./spec/url_builder_spec.rb:42:in `block (2 levels) in <top (required)>'\r\n\r\n  2) #url_builder when given a single parameter appends the parameters to the ur\r\nl\r\n     Failure/Error: url_builder(url, :results => 20).should == \"#{url}?results=20\"\r\n       expected: \"http://google.com?results=20&?results=20\"\r\n            got: \"http://google.com?results=20\" (using ==)\r\n     # ./spec/url_builder_spec.rb:18:in `block (3 levels) in <top (required)>'\r\n\r\n  3) #url_builder when given multiple parameters should append each parameter with an &\r\n     Failure/Error: url_builder(url, :results => '20', :search => 'burgers').should == \"#{url}?results=20&search=burgers\"\r\n       expected: \"http://google.com?results=20&search=burgers&?results=20&search=burgers\"\r\n            got: \"http://google.com?results=20&search=burgers\" (using ==)\r\n     # ./spec/url_builder_spec.rb:27:in `block (3 levels) in <top (required)>'\r\n\r\n  4) #url_builder when a parameter is nil should ignore the parameter\r\n     Failure/Error: url_builder(url, :results => '20', :search => 'burgers', :sort_by => nil).should == \"#{url}?results=20&search=burgers\"\r\n       expected: \"http://google.com?results=20&search=burgers&?results=20&search=burgers\"\r\n            got: \"http://google.com?results=20&search=burgers\" (using ==)\r\n     # ./spec/url_builder_spec.rb:35:in `block (3 levels) in <top (required)>'\r\n\r\nFinished in 0 seconds\r\n5 examples, 4 failures\r\n\r\nFailed examples:\r\n\r\nrspec ./spec/url_builder_spec.rb:41 # #url_builder should fail\r\nrspec ./spec/url_builder_spec.rb:17 # #url_builder when given a single parameter\r\n appends the parameters to the url\r\nrspec ./spec/url_builder_spec.rb:26 # #url_builder when given multiple parameter\r\ns should append each parameter with an &\r\nrspec ./spec/url_builder_spec.rb:34 # #url_builder when a parameter is nil shoul\r\nd ignore the parameter\r\n\r\nC:\\projects\\ruby\\cp110a\\week-04>\r\n\r\n\r\nNotice what is showing up in the expected result. With the first test there's no issue, but when you add the hash it changes the expectation. How strange is that?\r\n\r\n","html_url":"https://github.com/UWE-Ruby/week-04/issues/1","title":"issues with calling let(:url)","number":1,"id":2082488,"created_at":"2011-10-28T18:41:20Z"},"action":"opened"}