Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions courses/ruby/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ starting to work on tasks.
- [ex02-strings](./ex02-strings)
- [ex03-wallet](./ex03-wallet)

##### Resources:
#### Resources:

- [Enumerable](https://ruby-doc.org/core-2.6.3/Enumerable.html)
- [String](https://ruby-doc.org/core-2.4.0/String.html)
Expand All @@ -51,7 +51,7 @@ do part of the work at compile time that would otherwise be done at runtime.

- [ex04-myattr](./ex04-myattr)

##### Resources:
#### Resources:

- [Don't Know Metaprogramming In Ruby?](http://rubylearning.com/blog/2010/11/23/dont-know-metaprogramming-in-ruby/#what-is-metaprogramming:18bee3e64eb657db6a08ae0ff05e44b8)
- [How to Use attr_accessor, attr_writer & attr_reader](https://www.rubyguides.com/2018/11/attr_accessor/)
Expand Down
10 changes: 10 additions & 0 deletions courses/ruby/ex04-myattr/my_attr_reader_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -120,5 +120,15 @@ def initialize
# Check that only expected methods were defined.
assert_equal %i[readable1 readable2 readable3] - new_class_methods, []
end

def test_my_attr_reader_namespace
# skip
assert_raises NoMethodError do
my_attr_reader(:readable)
end

assert_respond_to Module, :my_attr_reader
assert_respond_to Class, :my_attr_reader
end
end