Skip to content

Commit

Permalink
Fix errors the occur when attempting to use a Gaga instance that is c…
Browse files Browse the repository at this point in the history
…reated without specifying a branch.
  • Loading branch information
nreckart committed Dec 1, 2011
1 parent 9549a02 commit 98e2538
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/gaga.rb
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ def git

# The git branch to use for this store
def branch
@options[:branch].to_s || 'master'
(@options[:branch] || 'master').to_s
end

# Checks out the branch on the repo
Expand Down
10 changes: 10 additions & 0 deletions test/gaga_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,16 @@
it "reads from keys" do
@store[key].must_be_nil
end

it "should default to master when no branch is specified" do
value = 'testing'
@master[key] = value
@master[key].must_equal value
@store[key].must_be_nil

tmp = Gaga.new(:repo => tmp_dir, :branch => :master)
tmp[key].must_equal value
end

it 'guarantess the key is stored in the right branch' do
@store[key] = 'value'
Expand Down

0 comments on commit 98e2538

Please sign in to comment.