This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# By leaning hard on the declarative nature of let(), you get to use | |
# a pattern where there is a single shared example whose | |
# expected result is defined at a lower level in the code. | |
# It is not really a pattern that is intuitive to everyone when | |
# they read this sort of code for the first time, so I am not about | |
# to claim it is better than other approaches, only different. | |
# There is no need for explicit tests to assert that the correct | |
# arguments are passed to the validators in this example, because | |
# if the arguments are not correct the doubles will not return the |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# I have a class that delegates functionality to a couple of objects that it | |
# constructs. I want to test this in isolation. I want to make sure that the | |
# objects are constructed with the right arguments. I also want to make sure | |
# that the results from the objects are handled correctly. | |
# | |
# I'm finding it hard to structure the code and test in a way that isn't | |
# cumbersome. What's below works, but it feels like a lot of stubbing and setup | |
# for something the should be simpler. | |
# | |
# Anyone got a better approach for this? |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# I have a class that delegates functionality to a couple of objects that it | |
# constructs. I want to test this in isolation. I want to make sure that the | |
# objects are constructed with the right arguments. I also want to make sure | |
# that the results from the objects are handled correctly. | |
# | |
# I'm finding it hard to structure the code and test in a way that isn't | |
# cumbersome. What's below works, but it feels like a lot of stubbing and setup | |
# for something the should be simpler. | |
# | |
# Anyone got a better approach for this? |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/´¯/) | |
,/¯ / | |
/ /´¯/'¯¯'/´¯¯¯`·¸ | |
/ / / / /¨¯\ | |
('( ´ ´ ¯~/' ') | |
\ ' / | |
'' \ _ ·´ | |
\ ( | |
\ \ |