Skip to content

Commit

Permalink
Pass only the conn object to the entry
Browse files Browse the repository at this point in the history
  • Loading branch information
JuanVqz committed Jan 21, 2023
1 parent f77bb5c commit ba4a1b9
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
4 changes: 2 additions & 2 deletions lib/noko_cli/entry.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ module NokoCli
class Entry
attr_reader :conn

def initialize(config:)
@conn = config.conn
def initialize(conn)
@conn = conn
end

def list
Expand Down
9 changes: 7 additions & 2 deletions lib/noko_cli/run.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,14 @@

module NokoCli
class Run # :nodoc:
attr_reader :config

def initialize
@config = Config.new
end

def self.call
@config ||= Config.new
Entry.new(config: @config).list
Entry.new(config.conn).list
end
end
end
2 changes: 1 addition & 1 deletion spec/noko_cli/entry_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
stub_request("current_user/entries", response: stub_response(fixture: "entries/list"))
end
let(:config) { NokoCli::Config.new(adapter: :test, stubs: stubs) }
let(:entries) { described_class.new(config: config) }
let(:entries) { described_class.new(config.conn) }

it "includes headers" do
headers = /date |minutes |project |description/
Expand Down

0 comments on commit ba4a1b9

Please sign in to comment.