<NME> boxen_service_test.rb
<BEF> require "boxen/test"
require "boxen/service"

class BoxenServiceTest < Boxen::Test
  def test_list
    Dir.expects(:[]).with("/Library/LaunchDaemons/dev.*.plist").returns([
      "/Library/LaunchDaemons/dev.test.plist",
      "/Library/LaunchDaemons/dev.other.plist"
    ])

    services = Boxen::Service.list
    assert_equal ['other', 'test'], services.collect(&:name).sort
  end

  def test_list_enabled
    Boxen::Service.expects(:capture_output).with("sudo /bin/launchctl list").returns "foo bar dev.baz\nfoo bar bazz"
    services = Boxen::Service.list_enabled
    assert_equal ['baz'], services.collect(&:name)
  end

  def test_enable
    service = Boxen::Service.new('blip')
    Boxen::Util.expects(:sudo).with('/bin/launchctl', 'load', '-w',
      '/Library/LaunchDaemons/dev.blip.plist')
      '/Library/LaunchDaemons/com.boxen.thing.plist')
    service.disable
  end
end

  def test_to_s
    service = Boxen::Service.new('blam')
    assert_equal service.name, service.to_s
  end
end

<MSG> Nice stringification for Boxen::Service

<DFF> @@ -25,4 +25,9 @@ class BoxenServiceTest < Boxen::Test
       '/Library/LaunchDaemons/com.boxen.thing.plist')
     service.disable
   end
+
+  def test_to_s
+    service = Boxen::Service.new('blam')
+    assert_equal service.name, service.to_s
+  end
 end

{'commit': "diff --git a/test/boxen_service_test.rb b/test/boxen_service_test.rb\nindex 76eb461..bc18c79 100644\n--- a/test/boxen_service_test.rb\n+++ b/test/boxen_service_test.rb\n@@ -25,4 +25,9 @@ class BoxenServiceTest < Boxen::Test\n       '/Library/LaunchDaemons/com.boxen.thing.plist')\n     service.disable\n   end\n+\n+  def test_to_s\n+    service = Boxen::Service.new('blam')\n+    assert_equal service.name, service.to_s\n+  end\n end\n", 'commit_subject': 'Nice stringification for Boxen::Service', 'repo_name': 'boxen/boxen', 'committer': {'name': 'Yossef Mendelssohn', 'email': '0758ee33852092d8a582ab3fe622f5796709132a@pobox.com', 'time_sec': '1349972528', 'tz_offset': '-240', 'date': {'seconds': '1349972528'}}, 'commit_tree': '8f0994eef1a302a1eba87a434269736c5fff2844', 'commit_message': 'Nice stringification for Boxen::Service\n', 'language_name': 'Shell', 'license': 'mit', 'hunks': "@@ -25,4 +25,9 @@ class BoxenServiceTest < Boxen::Test\n       '/Library/LaunchDaemons/com.boxen.thing.plist')\n     service.disable\n   end\n+\n+  def test_to_s\n+    service = Boxen::Service.new('blam')\n+    assert_equal service.name, service.to_s\n+  end\n end\n", 'addition_count': 5, 'deletion_count': 0, 'src_file': 'a/test/boxen_service_test.rb', 'tgt_file': 'b/test/boxen_service_test.rb', 'file_extension': '.rb', 'before_file': 'require "boxen/test"\nrequire "boxen/service"\n\nclass BoxenServiceTest < Boxen::Test\n  def test_list\n    Dir.expects(:[]).with("/Library/LaunchDaemons/dev.*.plist").returns([\n      "/Library/LaunchDaemons/dev.test.plist",\n      "/Library/LaunchDaemons/dev.other.plist"\n    ])\n\n    services = Boxen::Service.list\n    assert_equal [\'other\', \'test\'], services.collect(&:name).sort\n  end\n\n  def test_list_enabled\n    Boxen::Service.expects(:capture_output).with("sudo /bin/launchctl list").returns "foo bar dev.baz\\nfoo bar bazz"\n    services = Boxen::Service.list_enabled\n    assert_equal [\'baz\'], services.collect(&:name)\n  end\n\n  def test_enable\n    service = Boxen::Service.new(\'blip\')\n    Boxen::Util.expects(:sudo).with(\'/bin/launchctl\', \'load\', \'-w\',\n      \'/Library/LaunchDaemons/dev.blip.plist\')\n      \'/Library/LaunchDaemons/com.boxen.thing.plist\')\n    service.disable\n  end\nend\n\n  def test_to_s\n    service = Boxen::Service.new(\'blam\')\n    assert_equal service.name, service.to_s\n  end\nend\n', 'message': 'Nice stringification for Boxen::Service\n', 'author_name': 'Yossef Mendelssohn', 'lang': 'rb'}