learn-co-curriculum / ruby-intro-to-hashes-lab Goto Github PK
View Code? Open in Web Editor NEWLicense: Other
License: Other
line 148:
`mortgage_value` => '$800'
should be
'mortgage_value'
not a big deal but i was copying and pasting and it caused a moment of issues until i saw the mistake.
let's work on breaking up some of the expect()
s into separate it
blocks , especially towards the end. I think they're a bit overwhelming, especially for beginners.
I also really want to figure out a way so that they don't have to repeat their code for each spec :) I don't know how but i think there's a way. let's consult tomorrow and ask for help.
and the unused file in it. I think it can confuse students to see something like that.
you're asking students to make specific hashes with specific keys and values that the spec requires them to make. i think there should be more exposition in the readme about what they're making. go into monopoly, maybe give an example of a hash with that data would look like.
building a multidimensional monopoly hash
adding a key-value pair to the top level of the monopoly hash
#monopoly
add a key value pair to the monopoly hash. The KEY should be :railroads and the value should be an empty hash (FAILED - 1)
Example - This won't pass tests
names: {
reading_railroad: {
"mortgage_value":"$100"
},
pennsylvania_railroad: {
"mortgage_value":"$200"
},
b_and_o_railroad: {
"mortgage_value":"$400"
},
shortline: {
"mortgage_value":"$800"
}
},
Example - This will pass the tests
names: {
reading_railroad: {
"mortgage_value"=>"$100"
},
pennsylvania_railroad: {
"mortgage_value"=>"$200"
},
b_and_o_railroad: {
"mortgage_value"=>"$400"
},
shortline: {
"mortgage_value"=>"$800"
}
},
In the r_spec test, the build is in the wrong order. It should be :rent_in_dollars, then :names.
i just thought that this let block is going to be confusing for them, because it's most likely the first time they're seeing it, and specifically working with it in a spec. i don't think we should go into it too much, but maybe a quick bit about what this is doing.
let(:monopoly) { {} }
Hello. If you look at the monopoly hash in the README and examine monopoly[:railroads], its values (which themselves are keys) are in this order:
:pieces, :rent_in_dollars, :names.
However, the tests specify that the values of monopoly[:railroads] are supposed to be in this exact order:
:pieces, :names, :rent_in_dollars.
I have attached a screenshot for clarity. Thank you for looking into this.
Sdcrouse
re-do so no more coding in spec
re-write readme to intro basic nested hashes
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.