Skip to content

karmen-fortis-swe/RubyStudy

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

💎 Ruby Study

This is a safe place to learn Ruby, practice making mistakes, practice writing tests, and get comfortable writing Ruby code without the possibility of breaking prod.

Ruby Basics

Resources:

Running Ruby code:

  • to run a Ruby file:
ruby "name_of_your_file"  
  • define a method:
def my_method(myinfo)
    puts myinfo
end
mymethod "my info goes here"
  • "irb" stands for interactive Ruby. Can be used to create a Ruby environment in the terminal.
  • installing a Gem from a local source
gem install --local path_to_gem/filename.gem

# can include in your Gem file 
gem "local_gem", :path => "../local_gem"

Testing

  • In most cases "empty" and not "nil" for tests.
  • How to run tests:
rails test
  • Where to find tests:
  • spec/spec_helper.rb | contains RSPec specific configs
  • spec/rails_helper.rb | contains Rails specific configs

Types of tests

Unit Tests Models, individual units of the app. Ex: Ensuring validations are working... Functional Tests Controllers, is a function working? Ex: Preventing a non-logged in user from performing an action. Integration Tests Full feature testing, from start to finish. Ex: Testing a business process like a user signing up for an app.

About

A safe place to learn Ruby, practice making mistakes, and get comfortable writing Ruby code without the possibility of breaking prod.

Resources

License

Stars

0 stars

Watchers

1 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages