diff --git a/test/test_command.rb b/test/test_command.rb index a792462..396c997 100644 --- a/test/test_command.rb +++ b/test/test_command.rb @@ -6,6 +6,11 @@ class TestCommand < Test::Unit::TestCase def setup + [Boom::Platform::Darwin, Boom::Platform::Linux, + Boom::Platform::Windows].each do |klass| + klass.any_instance.stubs('system') + end + IO.stubs(:popen) boom_json :urls end @@ -47,9 +52,9 @@ def test_list_detail end def test_list_all - #cmd = command('all') - #assert_match /urls/, cmd - #assert_match /github/, cmd + cmd = command('all') + assert_match /urls/, cmd + assert_match /github/, cmd end def test_list_creation @@ -81,17 +86,14 @@ def test_item_access_scoped_by_list end def test_item_open_item - Boom::Platform::Darwin.any_instance.stubs(:system).returns('') assert_match /opened https:\/\/github\.com for you/, command('open github') end def test_item_open_specific_item - Boom::Platform::Darwin.any_instance.stubs(:system).returns('') assert_match /opened https:\/\/github\.com for you/, command('open urls github') end def test_item_open_lists - Boom::Platform::Darwin.any_instance.stubs(:system).returns('') assert_match /opened all of urls for you/, command('open urls') end @@ -120,7 +122,7 @@ def test_item_deletion end def test_edit - Boom::Platform::Darwin.any_instance.stubs(:system).returns('') + Boom::Platform.stubs(:system).returns('') assert_match 'Make your edits', command('edit') end @@ -181,7 +183,6 @@ def test_version_switch def test_version_long assert_match /#{Boom::VERSION}/, command('--version') end - def test_stdin_pipes stub = Object.new stub.stubs(:stat).returns([1,2]) diff --git a/test/test_platform.rb b/test/test_platform.rb index 732c7ca..ae06834 100644 --- a/test/test_platform.rb +++ b/test/test_platform.rb @@ -9,15 +9,18 @@ def setup end def test_darwin - assert_equal Boom::Platform.platform.class, Boom::Platform::Darwin, RUBY_PLATFORM.include?('darwin') + assert_equal Boom::Platform.platform.class, + Boom::Platform::Darwin, RUBY_PLATFORM.include?('darwin') end def test_windows - assert_equal Boom::Platform.platform.class, Boom::Platform::Windows if RUBY_PLATFORM =~ /mswin|mingw/ + assert_equal Boom::Platform.platform.class, + Boom::Platform::Windows if RUBY_PLATFORM =~ /mswin|mingw/ end def test_linux - assert_equal Boom::Platform.platform.class, Boom::Platform::Linux if RUBY_PLATFORM =~ /mswin|mingw/ + assert_equal Boom::Platform.platform.class, + Boom::Platform::Linux if RUBY_PLATFORM =~ /mswin|mingw/ end def test_open_command_darwin