Sha256: 070939645e9dc8a29686f30d514eec763755082cf7c5b19c62b23f3ba264dd2c

Contents?: true

Size: 629 Bytes

Versions: 6

Compression:

Stored size: 629 Bytes

Contents

require "spec_helper"
require "fixtures/post"

describe ElabsMatchers::Matchers::Persist do
  let(:post) { ElabsMatchers::Orm::Post.create(:title => "New", :body => "Lorem") }
  subject { post }

  describe "#persist" do
    it "returns true if the value is the supplied" do
      should persist(:title, "Updated")
      expect { should_not persist(:title, "Updated") }.to fail_assertion
    end

    it "returns false if the value isn't the supplied" do
      post.stub(:title).and_return("New")

      should_not persist(:title, "Updated")
      expect { should persist(:title, "Updated") }.to fail_assertion
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
elabs_matchers-1.0.1 spec/elabs_matchers/matchers/persist_spec.rb
elabs_matchers-1.0.0 spec/elabs_matchers/matchers/persist_spec.rb
elabs_matchers-0.0.7 spec/elabs_matchers/matchers/persist_spec.rb
elabs_matchers-0.0.6 spec/elabs_matchers/matchers/persist_spec.rb
elabs_matchers-0.0.5 spec/elabs_matchers/matchers/persist_spec.rb
elabs_matchers-0.0.4 spec/elabs_matchers/matchers/persist_spec.rb