Permalink
Browse files

ran spec_converter

  • Loading branch information...
markburns committed Mar 18, 2012
1 parent 5a5b610 commit de44ff662bbf2d97003ac9c78b67342036e3b99a
Showing with 123 additions and 123 deletions.
  1. +5 −5 test/test_color.rb
  2. +42 −42 test/test_command.rb
  3. +5 −5 test/test_config.rb
  4. +21 −21 test/test_item.rb
  5. +32 −32 test/test_list.rb
  6. +16 −16 test/test_platform.rb
  7. +2 −2 test/test_remote.rb
View
@@ -2,27 +2,27 @@
class TestColor < Test::Unit::TestCase
- def test_colorize
+ it "colorize" do
assert_equal "\e[35mBoom!\e[0m",
Boom::Color.colorize("Boom!", :magenta)
end
- def test_magenta
+ it "magenta" do
assert_equal "\e[35mMagenta!\e[0m",
Boom::Color.magenta("Magenta!")
end
- def test_red
+ it "red" do
assert_equal "\e[31mRed!\e[0m",
Boom::Color.red("Red!")
end
- def test_yellow
+ it "yellow" do
assert_equal "\e[33mYellow!\e[0m",
Boom::Color.yellow("Yellow!")
end
- def test_cyan
+ it "cyan" do
assert_equal "\e[36mCyan!\e[0m",
Boom::Color.cyan("Cyan!")
end
View
@@ -5,7 +5,7 @@
class TestCommand < Test::Unit::TestCase
- def setup
+ before do
[Boom::Platform::Darwin, Boom::Platform::Linux,
Boom::Platform::Windows].each do |klass|
klass.any_instance.stubs('system')
@@ -22,201 +22,201 @@ def command(cmd)
output.gsub(/\e\[\d\d?m/, '')
end
- def test_use_remote
+ it "use remote" do
response = command('remote the_office fun awesome')
assert_match /a new list called the_office/, response
assert_match /fun in the_office is awesome/, response
end
- def test_remote_checks_for_acceptable_config
+ it "remote checks for acceptable config" do
response = command('remote the_office fun awesome')
assert_match /a new list called the_office/, response
assert_match /fun in the_office is awesome/, response
end
- def test_overview_for_empty
+ it "overview for empty" do
storage = Boom::Storage
storage.stubs(:lists).returns([])
Boom::Command.stubs(:storage).returns(storage)
assert_match /have anything yet!/, command(nil)
end
- def test_overview
- assert_equal ' urls (2)', command(nil)
+ it "overview" do
+ command(nil).should == ' urls (2)'
end
- def test_list_detail
+ it "list detail" do
assert_match /github/, command('urls')
end
- def test_list_all
+ it "list all" do
cmd = command('all')
assert_match /urls/, cmd
assert_match /github/, cmd
end
- def test_list_creation
+ it "list creation" do
assert_match /a new list called newlist/, command('newlist')
end
- def test_list_creation_with_item
+ it "list creation with item" do
assert_match /a new list called newlist.* item in newlist/, command('newlist item blah')
end
- def test_list_creation_with_item_stdin
+ it "list creation with item stdin" do
STDIN.stubs(:read).returns('blah')
STDIN.stubs(:stat)
STDIN.stat.stubs(:size).returns(4)
assert_match /a new list called newlist.* item in newlist is blah/, command('newlist item')
end
- def test_item_access
+ it "item access" do
IO.stubs(:popen)
assert_match /copied https:\/\/github\.com to your clipboard/,
command('github')
end
- def test_item_access_scoped_by_list
+ it "item access scoped by list" do
IO.stubs(:popen)
assert_match /copied https:\/\/github\.com to your clipboard/,
command('urls github')
end
- def test_item_open_item
+ it "item open item" do
assert_match /opened https:\/\/github\.com for you/, command('open github')
end
- def test_item_open_specific_item
+ it "item open specific item" do
assert_match /opened https:\/\/github\.com for you/, command('open urls github')
end
- def test_item_open_lists
+ it "item open lists" do
assert_match /opened all of urls for you/, command('open urls')
end
- def test_item_creation
+ it "item creation" do
assert_match /twitter in urls/,
command('urls twitter http://twitter.com/holman')
end
- def test_item_creation_long_value
+ it "item creation long value" do
assert_match /is tanqueray hendricks bombay/,
command('urls gins tanqueray hendricks bombay')
end
- def test_list_deletion_no
+ it "list deletion no" do
STDIN.stubs(:gets).returns('n')
assert_match /Just kidding then/, command('urls delete')
end
- def test_list_deletion_yes
+ it "list deletion yes" do
STDIN.stubs(:gets).returns('y')
assert_match /Deleted all your urls/, command('urls delete')
end
- def test_item_deletion
+ it "item deletion" do
assert_match /github is gone forever/, command('urls github delete')
end
- def test_help
+ it "help" do
assert_match 'boom help', command('help')
assert_match 'boom help', command('-h')
assert_match 'boom help', command('--help')
end
- def test_noop_options
+ it "noop options" do
assert_match 'boom help', command('--anything')
assert_match 'boom help', command('-d')
end
- def test_nonexistent_item_access_scoped_by_list
+ it "nonexistent item access scoped by list" do
assert_match /twitter not found in urls/, command('urls twitter')
end
- def test_echo_item
+ it "echo item" do
assert_match %r{https://github\.com}, command('echo github')
end
- def test_echo_item_shorthand
+ it "echo item shorthand" do
assert_match %r{https://github\.com}, command('e github')
end
- def test_echo_item_does_not_exist
+ it "echo item does not exist" do
assert_match /wrong.*not found/, command('echo wrong')
end
- def test_echo_list_item
+ it "echo list item" do
assert_match %r{https://github\.com}, command('echo urls github')
end
- def test_echo_list_item_does_not_exist
+ it "echo list item does not exist" do
assert_match /wrong not found in urls/, command('echo urls wrong')
end
- def test_show_storage
+ it "show storage" do
Boom::Config.any_instance.stubs(:attributes).returns('backend' => 'json')
assert_match /You're currently using json/, command('storage')
end
- def test_nonexistant_storage_switch
+ it "nonexistant storage switch" do
Boom::Config.any_instance.stubs(:save).returns(true)
assert_match /couldn't find that storage engine/, command('switch dkdkdk')
end
- def test_storage_switch
+ it "storage switch" do
Boom::Config.any_instance.stubs(:save).returns(true)
assert_match /We've switched you over to redis/, command('switch redis')
end
- def test_version_switch
+ it "version switch" do
assert_match /#{Boom::VERSION}/, command('-v')
end
- def test_version_long
+ it "version long" do
assert_match /#{Boom::VERSION}/, command('--version')
end
- def test_stdin_pipes
+ it "stdin pipes" do
stub = Object.new
stub.stubs(:stat).returns([1,2])
stub.stubs(:read).returns("http://twitter.com")
Boom::Command.stubs(:stdin).returns(stub)
assert_match /twitter in urls/, command('urls twitter')
end
- def test_random
+ it "random" do
Boom::Config.any_instance.stubs(:save).returns(true)
assert_match /opened .+ for you/, command('random')
end
- def test_random_from_list
+ it "random from list" do
Boom::Config.any_instance.stubs(:save).returns(true)
assert_match /(github|zachholman)/, command('random urls')
end
- def test_random_list_not_exist
+ it "random list not exist" do
Boom::Config.any_instance.stubs(:save).returns(true)
assert_match /couldn't find that list\./, command('random 39jc02jlskjbbac9')
end
- def test_delete_item_list_not_exist
+ it "delete item list not exist" do
assert_match /couldn't find that list\./, command('urlz github delete')
end
- def test_delete_item_wrong_list
+ it "delete item wrong list" do
command('urlz twitter https://twitter.com/')
assert_match /github not found in urlz/, command('urlz github delete')
end
- def test_delete_item_different_name
+ it "delete item different name" do
command('foo bar baz')
assert_match /bar is gone forever/, command('foo bar delete')
end
- def test_delete_item_same_name
+ it "delete item same name" do
command('duck duck goose')
assert_match /duck is gone forever/, command('duck duck delete')
end
View
@@ -5,22 +5,22 @@
class TestConfig < Test::Unit::TestCase
- def setup
+ before do
Boom::Config.any_instance.stubs(:file).
returns("test/examples/test_json.json")
@config = Boom::Config.new
@config.stubs(:save).returns(true)
end
- def test_bootstraps_config
+ it "bootstraps config" do
@config.bootstrap
- assert_equal ({:backend => 'json'}), @config.attributes
+ @config.attributes.should == ({:backend => 'json'})
end
- def test_attributes
+ it "attributes" do
@config.attributes[:wu_tang] = 'clan'
- assert_equal 'clan', @config.attributes[:wu_tang]
+ @config.attributes[:wu_tang].should == 'clan'
end
View
@@ -4,51 +4,51 @@
class TestItem < Test::Unit::TestCase
- def setup
+ before do
@item = Boom::Item.new('github','https://github.com')
end
- def test_name
- assert_equal 'github', @item.name
+ it "name" do
+ @item.name.should == 'github'
end
- def test_value
- assert_equal 'https://github.com', @item.value
+ it "value" do
+ @item.value.should == 'https://github.com'
end
- def test_short_name
- assert_equal 'github', @item.short_name
+ it "short name" do
+ @item.short_name.should == 'github'
end
- def test_short_name
+ it "short name" do
@item.name = 'github github github lol lol lol'
- assert_equal 'github github g…', @item.short_name
+ @item.short_name.should == 'github github g…'
end
- def test_spacer_none
+ it "spacer none" do
@item.name = 'github github github lol lol lol'
- assert_equal '', @item.spacer
+ @item.spacer.should == ''
end
- def test_spacer_tons
- assert_equal ' ', @item.spacer
+ it "spacer tons" do
+ @item.spacer.should == ' '
end
- def test_to_hash
- assert_equal 1, @item.to_hash.size
+ it "to hash" do
+ @item.to_hash.size.should == 1
end
- def test_url
- assert_equal 'https://github.com', @item.url
+ it "url" do
+ @item.url.should == 'https://github.com'
end
- def test_url_with_additional_description
+ it "url with additional description" do
@item = Boom::Item.new('github', 'social coding https://github.com')
- assert_equal 'https://github.com', @item.url
+ @item.url.should == 'https://github.com'
end
- def test_url_without_url
+ it "url without url" do
@item = Boom::Item.new('didum', 'dadam lol omg')
- assert_equal 'dadam lol omg', @item.url
+ @item.url.should == 'dadam lol omg'
end
end
Oops, something went wrong.

0 comments on commit de44ff6

Please sign in to comment.