Sha256: e39e88c98a067d6c5e79376e9e8af780bf7d5e2d3e23b63915d96567b7935bb9

Contents?: true

Size: 848 Bytes

Versions: 3

Compression:

Stored size: 848 Bytes

Contents

# -*- coding: utf-8 -*-
require 'minitest/autorun'
require 'simplecov'
SimpleCov.start

describe Fab do

  let(:fab){ Fab.new }

  describe "#username" do
    
    describe "with defaults" do

      before do
        @x = fab.username
      end

      it "is a string" do
        @x.must_be_kind_of String
      end

      it "is a short string of lowercase letters" do
        @x.must_match /\A[a-z]{5,15}\z/
      end

    end

    describe "with chars" do

      before do
        @chars = ['a','b']
        @x = fab.username(chars: @chars)
      end

      it "uses the chars" do
        @x.must_match /\A[ab]+\z/
      end

    end

    describe "with size" do

      before do
        @size = 20
        @x = fab.username(size: @size)
      end

      it "uses the size" do
        @x.size.must_equal @size
      end

    end

  end

end

  

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
sixarm_ruby_fab-1.0.2 test/sixarm_ruby_fab_test/username_test.rb
sixarm_ruby_fab-1.0.1 test/sixarm_ruby_fab_test/username_test.rb
sixarm_ruby_fab-1.0.0 test/sixarm_ruby_fab_test/username_test.rb