Ruby on Rails Sunday, May 1, 2011

On 30 April 2011 22:38, David Mr. <lists@ruby-forum.com> wrote:
> Colin Law wrote in post #995978:
>> On 30 April 2011 18:00, David Mr. <lists@ruby-forum.com> wrote:
>>>>
>>>> So gamma[:C] is not a collection. Have a look at the Rails Guide on
>>>
>>>
>>> attr_accessor :setA, :setB, :setAList, :setBList, :google
>>
>> First I would stick to the Rails conventions when naming things, so
>> these should be set_a and so on.
>>
>>> before_create :setup_data
>>> before_save :setup_data
>>> def setup_data
>>>  debugger
>>>  setax = []
>>>  setbx = []
>>
>> You don't need the above as split will return an array
>>
>>>  setax = setA.split(" ")
>>>  setbx = setB.split(" ")
>>
>> Are you saying that this method gets called ok but at this point,
>> checked in the debugger, that setA has a sensible value but setax does
>> not?
>>
>> It might help also if you explained whether any of the variables are
>> db columns and which are just instance variables.
>>
>> Colin
>
> As a quick reply...
>
> Yes setA has a sensible -as expected value, but setax is always nil.  I
> can go to the debugger window and do setax = setA.split(" ") and then
> setax has the proper value.  How is that happening?

So if you put a break point immediately after
setax = setA.split(" ")
then setax is nil, but if you then (while still broken) do
setax=setA.split(" ") then setax gets a value.
If so I find that most remarkable.

You have not said how setax and setbx are defined. Are they db cols
for the model in which setup_data is defined or what?

Colin

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

Ruby on Rails



On 1 May 2011, at 03:20, Gustavo de Sá Carvalho Honorato<gustavohonorato@gmail.com> wrote:

Hi, 

I'm starting to use Test::Unit to create unit tests for my Rails Applications/Plugins. I don't have much experience in Ruby Unit Testing. The problem is that the output report is very simple and it is very difficult to discover where is the error. Test::Unit does not show the line number of the error and the Stack Trace printed using the --trace option does not help either.

That's not the normal failing test output - it looks to me like things are blowing up before your test even gets run. Do you have any idea where this score= problem could be coming from?


Fred

Here is the output of my test:

/home/gustavo/.rvm/rubies/ruby-1.9.2-p180/bin/ruby -e $stdout.sync=true;$stderr.sync=true;load($0=ARGV.shift) /home/gustavo/.rvm/rubies/ruby-1.9.2-p180/bin/rake test:plugins --trace
Testing started at 23:18 ...
(in /home/gustavo/Projetos/seo_apps)
** Invoke test:plugins (first_time)
** Invoke environment (first_time)
** Execute environment
** Execute test:plugins

NoMethodError: undefined method `score=' for #<Report:0xa1f269c>
1 tests, 0 assertions, 0 failures, 1 errors, 0 pendings, 0 omissions, 0 notifications
Test suite finished: 0.132010162 seconds
rake aborted!
Command failed with status (1): [/home/gustavo/.rvm/rubies/ruby-1.9.2-p180/...]
/home/gustavo/.rvm/gems/ruby-1.9.2-p180/gems/rake-0.8.7/lib/rake.rb:995:in `block in sh'
/home/gustavo/.rvm/gems/ruby-1.9.2-p180/gems/rake-0.8.7/lib/rake.rb:1010:in `call'
/home/gustavo/.rvm/gems/ruby-1.9.2-p180/gems/rake-0.8.7/lib/rake.rb:1010:in `sh'
/home/gustavo/.rvm/gems/ruby-1.9.2-p180/gems/rake-0.8.7/lib/rake.rb:1094:in `sh'
/home/gustavo/.rvm/gems/ruby-1.9.2-p180/gems/rake-0.8.7/lib/rake.rb:1029:in `ruby'
/home/gustavo/.rvm/gems/ruby-1.9.2-p180/gems/rake-0.8.7/lib/rake.rb:1094:in `ruby'
/home/gustavo/.rvm/gems/ruby-1.9.2-p180/gems/railties-3.0.5/lib/rails/test_unit/testing.rake:26:in `block (2 levels) in define'
/home/gustavo/.rvm/gems/ruby-1.9.2-p180/gems/rake-0.8.7/lib/rake.rb:1112:in `verbose'
/home/gustavo/.rvm/gems/ruby-1.9.2-p180/gems/railties-3.0.5/lib/rails/test_unit/testing.rake:11:in `block in define'
/home/gustavo/.rvm/gems/ruby-1.9.2-p180/gems/rake-0.8.7/lib/rake.rb:636:in `call'
/home/gustavo/.rvm/gems/ruby-1.9.2-p180/gems/rake-0.8.7/lib/rake.rb:636:in `block in execute'
/home/gustavo/.rvm/gems/ruby-1.9.2-p180/gems/rake-0.8.7/lib/rake.rb:631:in `each'
/home/gustavo/.rvm/gems/ruby-1.9.2-p180/gems/rake-0.8.7/lib/rake.rb:631:in `execute'
/home/gustavo/.rvm/gems/ruby-1.9.2-p180/gems/rake-0.8.7/lib/rake.rb:597:in `block in invoke_with_call_chain'
/home/gustavo/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/monitor.rb:201:in `mon_synchronize'
/home/gustavo/.rvm/gems/ruby-1.9.2-p180/gems/rake-0.8.7/lib/rake.rb:590:in `invoke_with_call_chain'
/home/gustavo/.rvm/gems/ruby-1.9.2-p180/gems/rake-0.8.7/lib/rake.rb:583:in `invoke'
/home/gustavo/.rvm/gems/ruby-1.9.2-p180/gems/rake-0.8.7/lib/rake.rb:2051:in `invoke_task'
/home/gustavo/.rvm/gems/ruby-1.9.2-p180/gems/rake-0.8.7/lib/rake.rb:2029:in `block (2 levels) in top_level'
/home/gustavo/.rvm/gems/ruby-1.9.2-p180/gems/rake-0.8.7/lib/rake.rb:2029:in `each'
/home/gustavo/.rvm/gems/ruby-1.9.2-p180/gems/rake-0.8.7/lib/rake.rb:2029:in `block in top_level'
/home/gustavo/.rvm/gems/ruby-1.9.2-p180/gems/rake-0.8.7/lib/rake.rb:2068:in `standard_exception_handling'
/home/gustavo/.rvm/gems/ruby-1.9.2-p180/gems/rake-0.8.7/lib/rake.rb:2023:in `top_level'
/home/gustavo/.rvm/gems/ruby-1.9.2-p180/gems/rake-0.8.7/lib/rake.rb:2001:in `block in run'
/home/gustavo/.rvm/gems/ruby-1.9.2-p180/gems/rake-0.8.7/lib/rake.rb:2068:in `standard_exception_handling'
/home/gustavo/.rvm/gems/ruby-1.9.2-p180/gems/rake-0.8.7/lib/rake.rb:1998:in `run'
/home/gustavo/.rvm/rubies/ruby-1.9.2-p180/bin/rake:35:in `<top (required)>'
-e:1:in `load'
-e:1:in `<main>'

Process finished with exit code 1


Please, anyone have an idea of how to improve this error output??

Thanks in advance,
Gustavo

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

Ruby on Rails

Hi All,
 Am new to rails ,am using fbgraph gem in rails 3 having the follwoing error

{    "error": {       "type": "OAuthException",       "message": "Invalid redirect_uri: Given URL is not allowed by the Application configuration."    } }

In my controller,

 
  def start
    redirect_to client.authorization.authorize_url(:redirect_uri => "http://localhost:3000/" , :scope => 'email,user_photos,friends_photos,publish_stream')
  end

i want to post,poke to friends via my app ,is any other plugin available for this .


Thanks in advance

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.