Sha256: 3e4a79ab1772236642e2f0c7d4be461b89745593d4c64f78a3cebe99490c2edc

Contents?: true

Size: 1.4 KB

Versions: 1

Compression:

Stored size: 1.4 KB

Contents

# test_env

My own personal test environment

# Example

    require 'test_env'
    
    class User
      attr_accessor :username, :email
      
      def to_s
        "#{@username} - #{@email}"
      end
    end

    class UserTest < TestEnvironment
      test_instance_of User do |user|
      
        # Setups run once before any assertions ever take place
        # You can have multiple setup blocks
        setup do
          @username = 'default'
          @email = 'default@domain.com'
        end
        
        assert 'output str should be correct' do
          user.to_s == 'default - default@domain.com'
        end
        
        assert 'output str should still be correct' do
          user.username = 'c00lryguy'
          user.email = 'c00lryguy@gmail.com'
          
          user.to_s == 'c00lryguy - c00lryguy@gmail.com'
        end
      end
    end
    
## Note on Patches/Pull Requests
 
* Fork the project.
* Make your feature addition or bug fix.
* Add tests for it. This is important so I don't break it in a
  future version unintentionally.
* Commit, do not mess with rakefile, version, or history.
  (if you want to have your own version, that is fine but bump version in a commit by itself I can ignore when I pull)
* Send me a pull request. Bonus points for topic branches.

## Copyright

Copyright (c) 2010 Ryan Lewis. See LICENSE for details.

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
test_env-0.1.1 README.md