save_and_open_page
have_button(locator)
=Navigating= | |
visit('/projects') | |
visit(post_comments_path(post)) | |
=Clicking links and buttons= | |
click_link('id-of-link') | |
click_link('Link Text') | |
click_button('Save') | |
click('Link Text') # Click either a link or a button | |
click('Button Value') |
# RSpec 2.0 syntax Cheet Sheet by http://ApproachE.com | |
# defining spec within a module will automatically pick Player::MovieList as a 'subject' (see below) | |
module Player | |
describe MovieList, "with optional description" do | |
it "is pending example, so that you can write ones quickly" | |
it "is already working example that we want to suspend from failing temporarily" do | |
pending("working on another feature that temporarily breaks this one") |
##git mergetool
In the middle file (future merged file), you can navigate between conflicts with ]c
and [c
.
Choose which version you want to keep with :diffget //2
or :diffget //3
(the //2
and //3
are unique identifiers for the target/master copy and the merge/branch copy file names).
:diffupdate (to remove leftover spacing issues)
:only (once you’re done reviewing all conflicts, this shows only the middle/merged file)
print "enter loan amount: " | |
loan = gets.chomp.to_i | |
print "Enter length of time in months: " | |
time = gets.chomp.to_i | |
print "Enter interest rate: " | |
rate = gets.chomp.to_f/100 | |
i = (1+rate/12)**(12/12)-1 | |
annuity = (1-(1/(1+i))**time)/i |
On Tue, Mar 12, 2013 at 1:26 PM, Martin Fowler martinfowlercom@gmail.com wrote:
The term pops up in some different places, so it's hard to know what it means without some context. In PoEAA I use the pattern Service Layer to represent a domain-oriented layer of behaviors that provide an API for the domain layer. This may or may not sit on top of a Domain Model. In DDD Eric Evans uses the term Service Object to refer to objects that represent processes (as opposed to Entities and Values). DDD Service Objects are often useful to factor out behavior that would otherwise bloat Entities, it's also a useful step to patterns like Strategy and Command.
It sounds like the DDD sense is the sense I'm encountering most often. I really need to read that book.
The conceptual problem I run into in a lot of codebases is that rather than representing a process, the "service objects" represent "a thing that does the process". Which sounds like a nitpicky difference, but it seems to have a real impact on how people us
This list is based on aliases_spec.rb.
You can see also Module: RSpec::Matchers API.
matcher | aliased to | description |
---|---|---|
a_truthy_value | be_truthy | a truthy value |
a_falsey_value | be_falsey | a falsey value |
be_falsy | be_falsey | be falsy |
a_falsy_value | be_falsey | a falsy value |
FROM alpine:latest | |
RUN apk add --update php python py-pip mysql-client \ | |
&& pip install awscli \ | |
&& rm -rf /var/cache/apk/* | |
RUN touch crontab.tmp \ | |
&& echo '* */6 * * * /usr/bin/php /var/www/partkeepr/app/console partkeepr:cron:run' > crontab.tmp \ | |
&& echo '0 2 * * * /usr/bin/sql_backup' >> crontab.tmp \ | |
&& crontab crontab.tmp \ |
Manage Emulators | |
android avd | |
Run Emulator | |
emulator -avd <AVD_Name> | |
Install apk onto emulator | |
adb -e install <path to apk> | |