spec/spec_helper.rb in slosilo-0.0.0 vs spec/spec_helper.rb in slosilo-0.1.2
- old
+ new
@@ -1,9 +1,6 @@
require "simplecov"
-require "simplecov-cobertura"
-
-SimpleCov.formatter = SimpleCov::Formatter::CoberturaFormatter
SimpleCov.start
require 'slosilo'
shared_context "with mock adapter" do
@@ -42,43 +39,24 @@
c/twlAJ7F6n3ZroF3lgPxMJRRHZl4Z4dJsDatIxVShf3nSGg9Mi5C25obxahbv5/
Dg1ikwi8GUF4HPZe9DyhXgDhg19wM/qcpjX8bSypsUWHWP+FanhjdWU=
-----END RSA PRIVATE KEY-----
""" }
let (:key) { Slosilo::Key.new rsa.to_der }
- let (:key_fingerprint) { "107bdb8501c419fad2fdb20b467d4d0a62a16a98c35f2da0eb3b1ff929795ad9" }
-
- let (:another_rsa) do
- OpenSSL::PKey::RSA.new """
------BEGIN RSA PRIVATE KEY-----
-MIIEowIBAAKCAQEAryP0uGEIcDFmHDj1MjxbW+eWMeQ1k2FTKI7qx2M3MP9FR3Bz
-KjFzGKnAA6QV46K/QtEt+wpWedB/bcikPXY4/vh/b2TEi8Ybw2ztT1oW9le8Djsz
-3sQv5QrHsOXzSIARw4NZYxunxMFKCVC9jA8tXJb16RLgS3wAOMiPADlWIKEmPIX6
-+hg2PDgFcrCuL3XAwJ4GKy3Q5BpIFF2j+wRNfjCXDFf1bU9Gy9DND8Y50Khhw/Zn
-GYN1Y3AZ3YPzz1SPf08WM663ImYwORjdkA5VlIAMKcmSStNZZUrCOo7DQjNZVD2O
-vfGhGUlPqYkmTPnCG2aNP8aJm3IbF+Cb6N6PjwIDAQABAoIBAEaYtr9PlagrsV40
-81kxjR3pptgrhhEHTQ7vNOH0Mz4T16gpQrLCRgOuARE2pgAhDPlw+hjUHPFzQrpN
-Ay8nJWhZYHzVYIh67ZwDn1C6HsFjshEGei0UZb3sb3v15O/Xd9GYc4KIlkKwKxjA
-K/d18rH8w9kUW8bxj+FTrpjHg9kYkWGjl1WUM4o4dALVVAbbILCHK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 def self.mock_own_key
+ before { Slosilo.stub(:[]).with(:own).and_return key }
end
+end
- def self.mock_own_key
- before { allow(Slosilo).to receive(:[]).with(:own).and_return key }
+class RackEnvironmentInputMatcher
+ def initialize expected
+ @expected = expected
end
+
+ def == env
+ env['rack.input'].read.should == @expected
+ end
+end
+
+def rack_environment_with_input expected
+ RackEnvironmentInputMatcher.new expected
end