Permalink
Browse files

modified 'network list' command to use network_members helper

  • Loading branch information...
1 parent deb53e3 commit 0fe87346344a4f48aed007567472af3a4a2724f9 @drnic drnic committed Nov 5, 2009
Showing with 11 additions and 5 deletions.
  1. +1 −4 lib/commands/network.rb
  2. +10 −1 spec/commands/command_network_spec.rb
View
@@ -20,10 +20,7 @@
when 'web'
helper.open helper.network_page_for(user)
when 'list'
- members = helper.get_network_members(user, options)
- members.each do |hsh|
- puts hsh["owner"]["login"]
- end
+ helper.network_members(user, options).each { |user| puts user }
when 'fetch'
# fetch each remote we don't have
data = helper.get_network_data(user, options)
@@ -4,6 +4,15 @@
describe "github network" do
include CommandHelper
+ specify "network list should show all users with a fork" do
+ running :network, 'list' do
+ setup_url_for 'origin', 'drnic'
+ users = %w[defunkt drnic _why]
+ @helper.should_receive(:network_members).with('drnic', {}).and_return(users)
+ stdout.should == "defunkt\ndrnic\n_why\n"
+ end
+ end
+
specify "network should open the network page for this repo" do
running :network, 'web' do
setup_url_for
@@ -17,5 +26,5 @@
@helper.should_receive(:open).once.with("https://github.com/defunkt/project/network")
end
end
-
+
end

0 comments on commit 0fe8734

Please sign in to comment.