Skip to content

jonalexander/ruby-variable-assignment-001-prework-web

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 

Repository files navigation

tags language resources
variable assignment, variables
ruby
2

Local Variable Assignment

Code your solution entirely within spec/assignment_spec.rb.

The goal of this lab is purposely basic, just simply test your ability to assign a local variable named greeting that is equal to Hello World.

You should first make sure the RSpec test suite is running correctly by running: rspec.

If you get:

-bash: rspec: command not found

You need to install rspec. Do that via gem install rspec

Upon the first run of the test suite you should see:

All examples were filtered out; ignoring {:focus=>true}
F

Failures:

  1) local variables should have a local scope
     Failure/Error: expect(greeting).to eq("Hello World")
     NameError:
       undefined local variable or method `greeting' for #<RSpec::Core::ExampleGroup::Nested_1:0x007fbde35b49a8>
     # ./spec/assignment_spec.rb:8:in `block (2 levels) in <top (required)>'

Finished in 0.00048 seconds
1 example, 1 failure

Failed examples:

rspec ./spec/assignment_spec.rb:5 # local variables should have a local scope

Solve that problem DIRECTLY in the assignment_spec.rb. Have fun!

Resources

About

No description, website, or topics provided.

Resources

License

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Ruby 100.0%