Skip to content

ArgumentError: API Key Required when setting key with block #15

@sunnyrjuneja

Description

@sunnyrjuneja

I noticed when a key has not been set and you set one with a block, it will throw an argument error. Here is how you can reproduce this:

require 'congress'

Congress.new do |congress|
  congress.key = 'abcd'
end

This happens in ruby 2.1.0p0, gems version 2.2.1, congress version 0.2.1. The reason the test did not pick this up is the before block sets a key.

Full Stack Trace:

/Users/sunnyjuneja/.rvm/gems/ruby-2.1.0/gems/congress-0.2.1/lib/congress/client.rb:12:in `initialize': API key required (ArgumentError)
        from /Users/sunnyjuneja/.rvm/gems/ruby-2.1.0/gems/congress-0.2.1/lib/congress.rb:13:in `new'
        from /Users/sunnyjuneja/.rvm/gems/ruby-2.1.0/gems/congress-0.2.1/lib/congress.rb:13:in `new'
        from reproduce.rb:3:in `<main>'

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions